diff options
Diffstat (limited to 'spec/ruby/core/main/fixtures')
| -rw-r--r-- | spec/ruby/core/main/fixtures/classes.rb | 26 | ||||
| -rw-r--r-- | spec/ruby/core/main/fixtures/string_refinement.rb | 7 | ||||
| -rw-r--r-- | spec/ruby/core/main/fixtures/string_refinement_user.rb | 11 | ||||
| -rw-r--r-- | spec/ruby/core/main/fixtures/using.rb | 1 | ||||
| -rw-r--r-- | spec/ruby/core/main/fixtures/using_in_main.rb | 5 | ||||
| -rw-r--r-- | spec/ruby/core/main/fixtures/using_in_method.rb | 5 | ||||
| -rw-r--r-- | spec/ruby/core/main/fixtures/wrapped_include.rb | 1 |
7 files changed, 56 insertions, 0 deletions
diff --git a/spec/ruby/core/main/fixtures/classes.rb b/spec/ruby/core/main/fixtures/classes.rb new file mode 100644 index 0000000000..757cee4e4a --- /dev/null +++ b/spec/ruby/core/main/fixtures/classes.rb @@ -0,0 +1,26 @@ +module MainSpecs + module Module + end + + module WrapIncludeModule + end + + DATA = {} +end + + +def main_public_method +end +public :main_public_method + +def main_public_method2 +end +public :main_public_method2 + +def main_private_method +end +private :main_private_method + +def main_private_method2 +end +private :main_private_method2 diff --git a/spec/ruby/core/main/fixtures/string_refinement.rb b/spec/ruby/core/main/fixtures/string_refinement.rb new file mode 100644 index 0000000000..2dc6de52ca --- /dev/null +++ b/spec/ruby/core/main/fixtures/string_refinement.rb @@ -0,0 +1,7 @@ +module StringRefinement + refine(String) do + def foo + 'foo' + end + end +end diff --git a/spec/ruby/core/main/fixtures/string_refinement_user.rb b/spec/ruby/core/main/fixtures/string_refinement_user.rb new file mode 100644 index 0000000000..48620c325f --- /dev/null +++ b/spec/ruby/core/main/fixtures/string_refinement_user.rb @@ -0,0 +1,11 @@ +using StringRefinement + +module MainSpecs + DATA[:in_module] = 'hello'.foo + + def self.call_foo(x) + x.foo + end +end + +MainSpecs::DATA[:toplevel] = 'hello'.foo diff --git a/spec/ruby/core/main/fixtures/using.rb b/spec/ruby/core/main/fixtures/using.rb new file mode 100644 index 0000000000..30713ef309 --- /dev/null +++ b/spec/ruby/core/main/fixtures/using.rb @@ -0,0 +1 @@ +using Module.new diff --git a/spec/ruby/core/main/fixtures/using_in_main.rb b/spec/ruby/core/main/fixtures/using_in_main.rb new file mode 100644 index 0000000000..a4a71c89cc --- /dev/null +++ b/spec/ruby/core/main/fixtures/using_in_main.rb @@ -0,0 +1,5 @@ +MAIN = self + +module X + MAIN.send(:using, Module.new) +end diff --git a/spec/ruby/core/main/fixtures/using_in_method.rb b/spec/ruby/core/main/fixtures/using_in_method.rb new file mode 100644 index 0000000000..d9ea2e9ef0 --- /dev/null +++ b/spec/ruby/core/main/fixtures/using_in_method.rb @@ -0,0 +1,5 @@ +def foo + using Module.new +end + +foo diff --git a/spec/ruby/core/main/fixtures/wrapped_include.rb b/spec/ruby/core/main/fixtures/wrapped_include.rb new file mode 100644 index 0000000000..307c98b419 --- /dev/null +++ b/spec/ruby/core/main/fixtures/wrapped_include.rb @@ -0,0 +1 @@ +include MainSpecs::WrapIncludeModule |
