diff options
Diffstat (limited to 'spec/ruby/core/binding/fixtures')
| -rw-r--r-- | spec/ruby/core/binding/fixtures/classes.rb | 26 | ||||
| -rw-r--r-- | spec/ruby/core/binding/fixtures/location.rb | 6 |
2 files changed, 32 insertions, 0 deletions
diff --git a/spec/ruby/core/binding/fixtures/classes.rb b/spec/ruby/core/binding/fixtures/classes.rb index 05ca2479ba..b5f3ce9008 100644 --- a/spec/ruby/core/binding/fixtures/classes.rb +++ b/spec/ruby/core/binding/fixtures/classes.rb @@ -25,6 +25,18 @@ module BindingSpecs __FILE__ end + def get_binding_with_send_and_line + [send(:binding), __LINE__] + end + + def get_binding_and_method + [binding, :get_binding_and_method] + end + + def get_binding_with_send_and_method + [send(:binding), :get_binding_with_send_and_method] + end + def get_empty_binding binding end @@ -37,4 +49,18 @@ module BindingSpecs end end end + + module AddFooToString + refine(String) do + def foo + "foo" + end + end + end + class Refined + using AddFooToString + def self.refined_binding + binding + end + end end 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 |
