Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Change Relation.new so the tuples are not mutable

  • Loading branch information...
commit 5b2644aa0fcfdf11725fdd6811cddf7548c81a24 1 parent 1cf3baa
Dan Kubb authored October 25, 2012
2  lib/veritas/relation.rb
@@ -73,7 +73,7 @@ def self.new(*args)
73 73
     # @api private
74 74
     def initialize(header, tuples)
75 75
       @header = Header.coerce(header)
76  
-      @tuples = tuples
  76
+      @tuples = Adamantium.freeze_object(tuples)
77 77
     end
78 78
 
79 79
     # Lookup an Attribute in the header given an attribute name
4  spec/unit/veritas/relation/empty/class_methods/new_spec.rb
@@ -19,12 +19,12 @@
19 19
   context 'with a header and tuples' do
20 20
     subject { object.new(header, tuples) }
21 21
 
22  
-    let(:tuples) { mock('Tuples') }
  22
+    let(:tuples) { [ mock('Tuple') ] }
23 23
 
24 24
     it { should be_instance_of(object) }
25 25
 
26 26
     its(:header){ should == header }
27 27
 
28  
-    its(:tuples) { should equal(tuples) }
  28
+    its(:tuples) { should eql(tuples) }
29 29
   end
30 30
 end

0 notes on commit 5b2644a

Please sign in to comment.
Something went wrong with that request. Please try again.