diff options
Diffstat (limited to 'spec/ruby/core/binding')
-rw-r--r-- | spec/ruby/core/binding/fixtures/location.rb | 6 | ||||
-rw-r--r-- | spec/ruby/core/binding/source_location_spec.rb | 11 |
2 files changed, 17 insertions, 0 deletions
diff --git a/spec/ruby/core/binding/fixtures/location.rb b/spec/ruby/core/binding/fixtures/location.rb new file mode 100644 index 0000000000..a78ae75731 --- /dev/null +++ b/spec/ruby/core/binding/fixtures/location.rb @@ -0,0 +1,6 @@ +module BindingSpecs + module LocationMethod + FILE_PATH = __FILE__ + TEST_BINDING = binding + end +end diff --git a/spec/ruby/core/binding/source_location_spec.rb b/spec/ruby/core/binding/source_location_spec.rb new file mode 100644 index 0000000000..e562bc65c8 --- /dev/null +++ b/spec/ruby/core/binding/source_location_spec.rb @@ -0,0 +1,11 @@ +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 + end +end |