summaryrefslogtreecommitdiff
path: root/spec/ruby/core/struct/shared
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/struct/shared')
-rw-r--r--spec/ruby/core/struct/shared/dup.rb9
-rw-r--r--spec/ruby/core/struct/shared/inspect.rb5
2 files changed, 9 insertions, 5 deletions
diff --git a/spec/ruby/core/struct/shared/dup.rb b/spec/ruby/core/struct/shared/dup.rb
new file mode 100644
index 0000000000..994f3f443e
--- /dev/null
+++ b/spec/ruby/core/struct/shared/dup.rb
@@ -0,0 +1,9 @@
+describe :struct_dup, shared: true do
+ it "duplicates members" do
+ klass = Struct.new(:foo, :bar)
+ instance = klass.new(14, 2)
+ duped = instance.send(@method)
+ duped.foo.should == 14
+ duped.bar.should == 2
+ end
+end
diff --git a/spec/ruby/core/struct/shared/inspect.rb b/spec/ruby/core/struct/shared/inspect.rb
deleted file mode 100644
index 90594a5452..0000000000
--- a/spec/ruby/core/struct/shared/inspect.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-describe :struct_inspect, shared: true do
- it "returns a string representation without the class name for anonymous structs" do
- Struct.new(:a).new("").send(@method).should == '#<struct a="">'
- end
-end