|
53 | 53 | end
|
54 | 54 | end
|
55 | 55 |
|
56 |
| -describe "Truffle::FeatureLoader.loaded_feature_path" do |
| 56 | +describe "Truffle::FeatureLoader.feature_path_loaded?" do |
57 | 57 | it "returns path for matching feature" do
|
58 | 58 | load_path = ["/path/ruby/lib/ruby/2.6.0"]
|
59 | 59 | loaded_feature = "/path/ruby/lib/ruby/2.6.0/benchmark.rb"
|
60 | 60 | feature = "benchmark"
|
61 |
| - path = Truffle::FeatureLoader.loaded_feature_path(loaded_feature, feature, load_path) |
62 |
| - path.should == load_path[0] |
| 61 | + path = Truffle::FeatureLoader.feature_path_loaded?(loaded_feature, feature, load_path) |
| 62 | + path.should be_true |
63 | 63 |
|
64 | 64 | feature = "benchmark.rb"
|
65 |
| - path = Truffle::FeatureLoader.loaded_feature_path(loaded_feature, feature, load_path) |
66 |
| - path.should == load_path[0] |
| 65 | + path = Truffle::FeatureLoader.feature_path_loaded?(loaded_feature, feature, load_path) |
| 66 | + path.should be_true |
67 | 67 | end
|
68 | 68 |
|
69 |
| - it "returns nil for missing features" do |
| 69 | + it "returns false for missing features" do |
70 | 70 | load_path = ["/path/ruby/lib/ruby/2.6.0"]
|
71 |
| - path = Truffle::FeatureLoader.loaded_feature_path("/path/ruby/lib/ruby/2.6.0/benchmark.rb", "missing", load_path) |
72 |
| - path.should == nil |
| 71 | + path = Truffle::FeatureLoader.feature_path_loaded?("/path/ruby/lib/ruby/2.6.0/benchmark.rb", "missing", load_path) |
| 72 | + path.should be_false |
73 | 73 |
|
74 | 74 | long_feature = "/path/ruby/lib/ruby/2.6.0/extra-path/benchmark.rb"
|
75 |
| - path = Truffle::FeatureLoader.loaded_feature_path("/path/ruby/lib/ruby/2.6.0/benchmark.rb", long_feature, load_path) |
76 |
| - path.should == nil |
| 75 | + path = Truffle::FeatureLoader.feature_path_loaded?("/path/ruby/lib/ruby/2.6.0/benchmark.rb", long_feature, load_path) |
| 76 | + path.should be_false |
77 | 77 | end
|
78 | 78 |
|
79 | 79 | it "returns correct paths for non-rb paths" do
|
80 | 80 | load_path = ["/path/ruby/lib/ruby/2.6.0"]
|
81 | 81 | loaded_feature = "/path/ruby/lib/ruby/2.6.0/benchmark.so"
|
82 | 82 |
|
83 | 83 | feature = "benchmark"
|
84 |
| - path = Truffle::FeatureLoader.loaded_feature_path(loaded_feature, feature, load_path) |
85 |
| - path.should == load_path[0] |
| 84 | + path = Truffle::FeatureLoader.feature_path_loaded?(loaded_feature, feature, load_path) |
| 85 | + path.should be_true |
86 | 86 |
|
87 | 87 | feature = "benchmark.so"
|
88 |
| - path = Truffle::FeatureLoader.loaded_feature_path(loaded_feature, feature, load_path) |
89 |
| - path.should == load_path[0] |
| 88 | + path = Truffle::FeatureLoader.feature_path_loaded?(loaded_feature, feature, load_path) |
| 89 | + path.should be_true |
90 | 90 |
|
91 | 91 | feature = "benchmark.rb"
|
92 |
| - path = Truffle::FeatureLoader.loaded_feature_path(loaded_feature, feature, load_path) |
93 |
| - path.should == nil |
| 92 | + path = Truffle::FeatureLoader.feature_path_loaded?(loaded_feature, feature, load_path) |
| 93 | + path.should be_false |
94 | 94 | end
|
95 | 95 |
|
96 | 96 | end
|
|
0 commit comments