diff options
Diffstat (limited to 'spec/ruby/core/binding/source_location_spec.rb')
| -rw-r--r-- | spec/ruby/core/binding/source_location_spec.rb | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/spec/ruby/core/binding/source_location_spec.rb b/spec/ruby/core/binding/source_location_spec.rb index e562bc65c8..d1c8191ea8 100644 --- a/spec/ruby/core/binding/source_location_spec.rb +++ b/spec/ruby/core/binding/source_location_spec.rb @@ -1,11 +1,14 @@ require_relative '../../spec_helper' require_relative 'fixtures/location' -ruby_version_is "2.6" do - describe "Binding#source_location" do - it "returns an [file, line] pair" do - b = BindingSpecs::LocationMethod::TEST_BINDING - b.source_location.should == [BindingSpecs::LocationMethod::FILE_PATH, 4] - end +describe "Binding#source_location" do + it "returns an [file, line] pair" do + b = BindingSpecs::LocationMethod::TEST_BINDING + b.source_location.should == [BindingSpecs::LocationMethod::FILE_PATH, 4] + end + + it "works for eval with a given line" do + b = eval('binding', nil, "foo", 100) + b.source_location.should == ["foo", 100] end end |
