summaryrefslogtreecommitdiff
path: root/spec/rubyspec/core/main
diff options
context:
space:
mode:
Diffstat (limited to 'spec/rubyspec/core/main')
-rw-r--r--spec/rubyspec/core/main/define_method_spec.rb28
-rw-r--r--spec/rubyspec/core/main/fixtures/classes.rb15
-rw-r--r--spec/rubyspec/core/main/fixtures/wrapped_include.rb1
-rw-r--r--spec/rubyspec/core/main/include_spec.rb16
-rw-r--r--spec/rubyspec/core/main/private_spec.rb23
-rw-r--r--spec/rubyspec/core/main/public_spec.rb23
-rw-r--r--spec/rubyspec/core/main/to_s_spec.rb7
7 files changed, 0 insertions, 113 deletions
diff --git a/spec/rubyspec/core/main/define_method_spec.rb b/spec/rubyspec/core/main/define_method_spec.rb
deleted file mode 100644
index 741e0624f8..0000000000
--- a/spec/rubyspec/core/main/define_method_spec.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-script_binding = binding
-
-describe "main#define_method" do
- before :each do
- @code = 'define_method(:boom) { :bam }'
- end
-
- after :each do
- Object.send :remove_method, :boom
- end
-
- it 'creates a public method in TOPLEVEL_BINDING' do
- eval @code, TOPLEVEL_BINDING
- Object.should have_method :boom
- end
-
- it 'creates a public method in script binding' do
- eval @code, script_binding
- Object.should have_method :boom
- end
-
- it 'returns the method name as symbol' do
- eval(@code, TOPLEVEL_BINDING).should equal :boom
- end
-end
diff --git a/spec/rubyspec/core/main/fixtures/classes.rb b/spec/rubyspec/core/main/fixtures/classes.rb
deleted file mode 100644
index 0b74080492..0000000000
--- a/spec/rubyspec/core/main/fixtures/classes.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-module MainSpecs
- module Module
- end
-
- module WrapIncludeModule
- end
-end
-
-def main_public_method
-end
-public :main_public_method
-
-def main_private_method
-end
-private :main_private_method
diff --git a/spec/rubyspec/core/main/fixtures/wrapped_include.rb b/spec/rubyspec/core/main/fixtures/wrapped_include.rb
deleted file mode 100644
index 307c98b419..0000000000
--- a/spec/rubyspec/core/main/fixtures/wrapped_include.rb
+++ /dev/null
@@ -1 +0,0 @@
-include MainSpecs::WrapIncludeModule
diff --git a/spec/rubyspec/core/main/include_spec.rb b/spec/rubyspec/core/main/include_spec.rb
deleted file mode 100644
index 1973bc8229..0000000000
--- a/spec/rubyspec/core/main/include_spec.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "main#include" do
- it "includes the given Module in Object" do
- eval "include MainSpecs::Module", TOPLEVEL_BINDING
- Object.ancestors.should include(MainSpecs::Module)
- end
-
- context "in a file loaded with wrapping" do
- it "includes the given Module in the load wrapper" do
- load(File.expand_path("../fixtures/wrapped_include.rb", __FILE__), true)
- Object.ancestors.should_not include(MainSpecs::WrapIncludeModule)
- end
- end
-end
diff --git a/spec/rubyspec/core/main/private_spec.rb b/spec/rubyspec/core/main/private_spec.rb
deleted file mode 100644
index 7e0a4ed57d..0000000000
--- a/spec/rubyspec/core/main/private_spec.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "main#private" do
- after :each do
- Object.send(:public, :main_public_method)
- end
-
- it "sets the visibility of the given method to private" do
- eval "private :main_public_method", TOPLEVEL_BINDING
- Object.should have_private_method(:main_public_method)
- end
-
- it "returns Object" do
- eval("private :main_public_method", TOPLEVEL_BINDING).should equal(Object)
- end
-
- it "raises a NameError when given an undefined name" do
- lambda do
- eval "private :main_undefined_method", TOPLEVEL_BINDING
- end.should raise_error(NameError)
- end
-end
diff --git a/spec/rubyspec/core/main/public_spec.rb b/spec/rubyspec/core/main/public_spec.rb
deleted file mode 100644
index 6906faee04..0000000000
--- a/spec/rubyspec/core/main/public_spec.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
-
-describe "main#public" do
- after :each do
- Object.send(:private, :main_private_method)
- end
-
- it "sets the visibility of the given method to public" do
- eval "public :main_private_method", TOPLEVEL_BINDING
- Object.should_not have_private_method(:main_private_method)
- end
-
- it "returns Object" do
- eval("public :main_private_method", TOPLEVEL_BINDING).should equal(Object)
- end
-
- it "raises a NameError when given an undefined name" do
- lambda do
- eval "public :main_undefined_method", TOPLEVEL_BINDING
- end.should raise_error(NameError)
- end
-end
diff --git a/spec/rubyspec/core/main/to_s_spec.rb b/spec/rubyspec/core/main/to_s_spec.rb
deleted file mode 100644
index dd5a02b0ae..0000000000
--- a/spec/rubyspec/core/main/to_s_spec.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-describe "main#to_s" do
- it "returns 'main'" do
- eval('to_s', TOPLEVEL_BINDING).should == "main"
- end
-end