summaryrefslogtreecommitdiff
path: root/spec/ruby/core/struct/deconstruct_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/struct/deconstruct_spec.rb')
-rw-r--r--spec/ruby/core/struct/deconstruct_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/ruby/core/struct/deconstruct_spec.rb b/spec/ruby/core/struct/deconstruct_spec.rb
new file mode 100644
index 0000000000..32d4f6bac4
--- /dev/null
+++ b/spec/ruby/core/struct/deconstruct_spec.rb
@@ -0,0 +1,10 @@
+require_relative '../../spec_helper'
+
+describe "Struct#deconstruct" do
+ it "returns an array of attribute values" do
+ struct = Struct.new(:x, :y)
+ s = struct.new(1, 2)
+
+ s.deconstruct.should == [1, 2]
+ end
+end