summaryrefslogtreecommitdiff
path: root/spec/ruby/library/matrix/hash_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/matrix/hash_spec.rb')
-rw-r--r--spec/ruby/library/matrix/hash_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/ruby/library/matrix/hash_spec.rb b/spec/ruby/library/matrix/hash_spec.rb
new file mode 100644
index 0000000000..b2e5b579b7
--- /dev/null
+++ b/spec/ruby/library/matrix/hash_spec.rb
@@ -0,0 +1,15 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+require 'matrix'
+
+describe "Matrix#hash" do
+
+ it "returns a Fixnum" do
+ Matrix[ [1,2] ].hash.should be_an_instance_of(Fixnum)
+ end
+
+ it "returns the same value for the same matrix" do
+ data = [ [40,5], [2,7] ]
+ Matrix[ *data ].hash.should == Matrix[ *data ].hash
+ end
+
+end