dm-core 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. data/CHANGELOG +144 -0
  2. data/FAQ +74 -0
  3. data/MIT-LICENSE +22 -0
  4. data/QUICKLINKS +12 -0
  5. data/README +143 -0
  6. data/lib/dm-core.rb +213 -0
  7. data/lib/dm-core/adapters.rb +4 -0
  8. data/lib/dm-core/adapters/abstract_adapter.rb +202 -0
  9. data/lib/dm-core/adapters/data_objects_adapter.rb +701 -0
  10. data/lib/dm-core/adapters/mysql_adapter.rb +132 -0
  11. data/lib/dm-core/adapters/postgres_adapter.rb +179 -0
  12. data/lib/dm-core/adapters/sqlite3_adapter.rb +105 -0
  13. data/lib/dm-core/associations.rb +172 -0
  14. data/lib/dm-core/associations/many_to_many.rb +138 -0
  15. data/lib/dm-core/associations/many_to_one.rb +101 -0
  16. data/lib/dm-core/associations/one_to_many.rb +275 -0
  17. data/lib/dm-core/associations/one_to_one.rb +61 -0
  18. data/lib/dm-core/associations/relationship.rb +116 -0
  19. data/lib/dm-core/associations/relationship_chain.rb +74 -0
  20. data/lib/dm-core/auto_migrations.rb +64 -0
  21. data/lib/dm-core/collection.rb +604 -0
  22. data/lib/dm-core/hook.rb +11 -0
  23. data/lib/dm-core/identity_map.rb +45 -0
  24. data/lib/dm-core/is.rb +16 -0
  25. data/lib/dm-core/logger.rb +233 -0
  26. data/lib/dm-core/migrations/destructive_migrations.rb +17 -0
  27. data/lib/dm-core/migrator.rb +29 -0
  28. data/lib/dm-core/model.rb +399 -0
  29. data/lib/dm-core/naming_conventions.rb +52 -0
  30. data/lib/dm-core/property.rb +611 -0
  31. data/lib/dm-core/property_set.rb +158 -0
  32. data/lib/dm-core/query.rb +590 -0
  33. data/lib/dm-core/repository.rb +159 -0
  34. data/lib/dm-core/resource.rb +618 -0
  35. data/lib/dm-core/scope.rb +35 -0
  36. data/lib/dm-core/support.rb +7 -0
  37. data/lib/dm-core/support/array.rb +13 -0
  38. data/lib/dm-core/support/assertions.rb +8 -0
  39. data/lib/dm-core/support/errors.rb +23 -0
  40. data/lib/dm-core/support/kernel.rb +7 -0
  41. data/lib/dm-core/support/symbol.rb +41 -0
  42. data/lib/dm-core/transaction.rb +267 -0
  43. data/lib/dm-core/type.rb +160 -0
  44. data/lib/dm-core/type_map.rb +80 -0
  45. data/lib/dm-core/types.rb +19 -0
  46. data/lib/dm-core/types/boolean.rb +7 -0
  47. data/lib/dm-core/types/discriminator.rb +32 -0
  48. data/lib/dm-core/types/object.rb +20 -0
  49. data/lib/dm-core/types/paranoid_boolean.rb +23 -0
  50. data/lib/dm-core/types/paranoid_datetime.rb +22 -0
  51. data/lib/dm-core/types/serial.rb +9 -0
  52. data/lib/dm-core/types/text.rb +10 -0
  53. data/spec/integration/association_spec.rb +1215 -0
  54. data/spec/integration/association_through_spec.rb +150 -0
  55. data/spec/integration/associations/many_to_many_spec.rb +171 -0
  56. data/spec/integration/associations/many_to_one_spec.rb +123 -0
  57. data/spec/integration/associations/one_to_many_spec.rb +66 -0
  58. data/spec/integration/auto_migrations_spec.rb +398 -0
  59. data/spec/integration/collection_spec.rb +1015 -0
  60. data/spec/integration/data_objects_adapter_spec.rb +32 -0
  61. data/spec/integration/model_spec.rb +68 -0
  62. data/spec/integration/mysql_adapter_spec.rb +85 -0
  63. data/spec/integration/postgres_adapter_spec.rb +732 -0
  64. data/spec/integration/property_spec.rb +224 -0
  65. data/spec/integration/query_spec.rb +376 -0
  66. data/spec/integration/repository_spec.rb +57 -0
  67. data/spec/integration/resource_spec.rb +324 -0
  68. data/spec/integration/sqlite3_adapter_spec.rb +352 -0
  69. data/spec/integration/sti_spec.rb +185 -0
  70. data/spec/integration/transaction_spec.rb +75 -0
  71. data/spec/integration/type_spec.rb +149 -0
  72. data/spec/lib/mock_adapter.rb +27 -0
  73. data/spec/spec_helper.rb +112 -0
  74. data/spec/unit/adapters/abstract_adapter_spec.rb +133 -0
  75. data/spec/unit/adapters/adapter_shared_spec.rb +15 -0
  76. data/spec/unit/adapters/data_objects_adapter_spec.rb +627 -0
  77. data/spec/unit/adapters/postgres_adapter_spec.rb +125 -0
  78. data/spec/unit/associations/many_to_many_spec.rb +14 -0
  79. data/spec/unit/associations/many_to_one_spec.rb +138 -0
  80. data/spec/unit/associations/one_to_many_spec.rb +385 -0
  81. data/spec/unit/associations/one_to_one_spec.rb +7 -0
  82. data/spec/unit/associations/relationship_spec.rb +67 -0
  83. data/spec/unit/associations_spec.rb +205 -0
  84. data/spec/unit/auto_migrations_spec.rb +110 -0
  85. data/spec/unit/collection_spec.rb +174 -0
  86. data/spec/unit/data_mapper_spec.rb +21 -0
  87. data/spec/unit/identity_map_spec.rb +126 -0
  88. data/spec/unit/is_spec.rb +80 -0
  89. data/spec/unit/migrator_spec.rb +33 -0
  90. data/spec/unit/model_spec.rb +339 -0
  91. data/spec/unit/naming_conventions_spec.rb +28 -0
  92. data/spec/unit/property_set_spec.rb +96 -0
  93. data/spec/unit/property_spec.rb +447 -0
  94. data/spec/unit/query_spec.rb +485 -0
  95. data/spec/unit/repository_spec.rb +93 -0
  96. data/spec/unit/resource_spec.rb +557 -0
  97. data/spec/unit/scope_spec.rb +131 -0
  98. data/spec/unit/transaction_spec.rb +493 -0
  99. data/spec/unit/type_map_spec.rb +114 -0
  100. data/spec/unit/type_spec.rb +119 -0
  101. metadata +187 -0
@@ -0,0 +1,7 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'spec_helper'))
2
+
3
+ describe "DataMapper::Associations::OneToOne" do
4
+
5
+ it "should allow a declaration" do
6
+ end
7
+ end
@@ -0,0 +1,67 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'spec_helper'))
2
+
3
+ describe DataMapper::Associations::Relationship do
4
+ it "should describe an association" do
5
+ belongs_to = DataMapper::Associations::Relationship.new(
6
+ :manufacturer,
7
+ :mock,
8
+ 'Vehicle',
9
+ 'Manufacturer',
10
+ { :child_key => [ :manufacturer_id ] }
11
+ )
12
+
13
+ belongs_to.should respond_to(:name)
14
+ belongs_to.should respond_to(:repository_name)
15
+ belongs_to.should respond_to(:child_key)
16
+ belongs_to.should respond_to(:parent_key)
17
+ end
18
+
19
+ it "should map properties explicitly when an association method passes them in its options" do
20
+ repository_name = :mock
21
+
22
+ belongs_to = DataMapper::Associations::Relationship.new(
23
+ :manufacturer,
24
+ repository_name,
25
+ 'Vehicle',
26
+ 'Manufacturer',
27
+ { :child_key => [ :manufacturer_id ], :parent_key => [ :id ] }
28
+ )
29
+
30
+ belongs_to.name.should == :manufacturer
31
+ belongs_to.repository_name.should == repository_name
32
+
33
+ belongs_to.child_key.should be_a_kind_of(DataMapper::PropertySet)
34
+ belongs_to.parent_key.should be_a_kind_of(DataMapper::PropertySet)
35
+
36
+ belongs_to.child_key.to_a.should == Vehicle.properties(repository_name).slice(:manufacturer_id)
37
+ belongs_to.parent_key.to_a.should == Manufacturer.properties(repository_name).key
38
+ end
39
+
40
+ it "should infer properties when options aren't passed" do
41
+ repository_name = :mock
42
+
43
+ has_many = DataMapper::Associations::Relationship.new(
44
+ :models,
45
+ repository_name,
46
+ 'Vehicle',
47
+ 'Manufacturer'
48
+ )
49
+
50
+ has_many.name.should == :models
51
+ has_many.repository_name.should == repository_name
52
+
53
+ has_many.child_key.should be_a_kind_of(DataMapper::PropertySet)
54
+ has_many.parent_key.should be_a_kind_of(DataMapper::PropertySet)
55
+
56
+ has_many.child_key.to_a.should == Vehicle.properties(repository_name).slice(:models_id)
57
+ has_many.parent_key.to_a.should == Manufacturer.properties(repository_name).key
58
+ end
59
+
60
+ it "should generate child properties with a safe subset of the parent options" do
61
+ pending
62
+ # For example, :size would be an option you'd want a generated child Property to copy,
63
+ # but :serial or :key obviously not. So need to take a good look at Property::OPTIONS to
64
+ # see what applies and what doesn't.
65
+ end
66
+
67
+ end
@@ -0,0 +1,205 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
2
+
3
+ describe "DataMapper::Associations" do
4
+ before do
5
+ @relationship = mock(DataMapper::Associations::Relationship)
6
+ @n = 1.0/0
7
+
8
+ Manufacturer.mock_relationship = Vehicle.mock_relationship = @relationship
9
+ end
10
+
11
+ describe ".relationships" do
12
+ class B
13
+ include DataMapper::Resource
14
+ end
15
+
16
+ class C
17
+ include DataMapper::Resource
18
+
19
+ repository(:mock) do
20
+ has 1, :b
21
+ end
22
+ end
23
+
24
+ class D
25
+ include DataMapper::Resource
26
+ has 1, :b
27
+ end
28
+
29
+ class E < D
30
+ end
31
+
32
+ class F < D
33
+ has 1, :a
34
+ end
35
+
36
+ it "should assume the default repository when no arguments are passed" do
37
+ lambda do
38
+ C.relationships
39
+ end.should_not raise_error
40
+ end
41
+
42
+ it "should return the right set of relationships given the repository name" do
43
+ C.relationships.should be_empty
44
+ C.relationships(:mock).should_not be_empty
45
+ end
46
+
47
+ it "should return the right set of relationships given the inheritance" do
48
+ E.relationships.should have(1).entries
49
+ D.relationships.should have(1).entries
50
+ F.relationships.should have(2).entries
51
+ end
52
+ end
53
+
54
+ describe ".has" do
55
+
56
+ it "should allow a declaration" do
57
+ lambda do
58
+ class Manufacturer
59
+ has 1, :halo_car
60
+ end
61
+ end.should_not raise_error
62
+ end
63
+
64
+ it "should not allow a constraint that is not an Integer, Range or Infinity" do
65
+ lambda do
66
+ class Manufacturer
67
+ has '1', :halo_car
68
+ end
69
+ end.should raise_error(ArgumentError)
70
+ end
71
+
72
+ it "should not allow a constraint where the min is larger than the max" do
73
+ lambda do
74
+ class Manufacturer
75
+ has 1..0, :halo_car
76
+ end
77
+ end.should raise_error(ArgumentError)
78
+ end
79
+
80
+ it "should not allow overwriting of the auto assigned min/max values with keys" do
81
+ DataMapper::Associations::OneToMany.should_receive(:setup).
82
+ with(:vehicles, Manufacturer, { :min => 1, :max => 2 }).
83
+ and_return(@relationship)
84
+
85
+ class Manufacturer
86
+ has(1..2, :vehicles, :min => 5, :max => 10).should == mock_relationship
87
+ end
88
+ end
89
+
90
+ describe "one-to-one syntax" do
91
+ it "should create a basic one-to-one association with fixed constraint" do
92
+ DataMapper::Associations::OneToOne.should_receive(:setup).
93
+ with(:halo_car, Manufacturer, { :min => 1, :max => 1 }).
94
+ and_return(@relationship)
95
+
96
+ class Manufacturer
97
+ has(1, :halo_car).should == mock_relationship
98
+ end
99
+ end
100
+
101
+ it "should create a basic one-to-one association with min/max constraints" do
102
+ DataMapper::Associations::OneToOne.should_receive(:setup).
103
+ with(:halo_car, Manufacturer, { :min => 0, :max => 1 }).
104
+ and_return(@relationship)
105
+
106
+ class Manufacturer
107
+ has(0..1, :halo_car).should == mock_relationship
108
+ end
109
+ end
110
+
111
+ it "should create a one-to-one association with options" do
112
+ DataMapper::Associations::OneToOne.should_receive(:setup).
113
+ with(:halo_car, Manufacturer, { :min => 1, :max => 1, :class_name => 'Car' }).
114
+ and_return(@relationship)
115
+
116
+ class Manufacturer
117
+ has(1, :halo_car, :class_name => 'Car').should == mock_relationship
118
+ end
119
+ end
120
+ end
121
+
122
+ describe "one-to-many syntax" do
123
+ it "should create a basic one-to-many association with no constraints" do
124
+ DataMapper::Associations::OneToMany.should_receive(:setup).
125
+ with(:vehicles, Manufacturer, { :min => 0, :max => @n }).
126
+ and_return(@relationship)
127
+
128
+ class Manufacturer
129
+ has(n, :vehicles).should == mock_relationship
130
+ end
131
+ end
132
+
133
+ it "should create a one-to-many association with fixed constraint" do
134
+ DataMapper::Associations::OneToMany.should_receive(:setup).
135
+ with(:vehicles, Manufacturer, { :min => 4, :max => 4 }).
136
+ and_return(@relationship)
137
+
138
+ class Manufacturer
139
+ has(4, :vehicles).should == mock_relationship
140
+ end
141
+ end
142
+
143
+ it "should create a one-to-many association with min/max constraints" do
144
+ DataMapper::Associations::OneToMany.should_receive(:setup).
145
+ with(:vehicles, Manufacturer, { :min => 2, :max => 4 }).
146
+ and_return(@relationship)
147
+
148
+ class Manufacturer
149
+ has(2..4, :vehicles).should == mock_relationship
150
+ end
151
+ end
152
+
153
+ it "should create a one-to-many association with options" do
154
+ DataMapper::Associations::OneToMany.should_receive(:setup).
155
+ with(:vehicles, Manufacturer, { :min => 1, :max => @n, :class_name => 'Car' }).
156
+ and_return(@relationship)
157
+
158
+ class Manufacturer
159
+ has(1..n, :vehicles, :class_name => 'Car').should == mock_relationship
160
+ end
161
+ end
162
+
163
+ # do not remove or change this spec.
164
+ it "should raise an exception when n..n is used for the cardinality" do
165
+ lambda do
166
+ class Manufacturer
167
+ has n..n, :subsidiaries, :class_name => 'Manufacturer'
168
+ end
169
+ end.should raise_error(ArgumentError)
170
+ end
171
+
172
+ it "should create one-to-many association and pass the :through option if specified" do
173
+ DataMapper::Associations::OneToMany.should_receive(:setup).
174
+ with(:suppliers, Vehicle, { :min => 0, :max => @n, :through => :manufacturers }).
175
+ and_return(@relationship)
176
+
177
+ class Vehicle
178
+ has(n, :suppliers, :through => :manufacturers).should == mock_relationship
179
+ end
180
+ end
181
+ end
182
+ end
183
+
184
+ describe ".belongs_to" do
185
+ it "should create a basic many-to-one association" do
186
+ DataMapper::Associations::ManyToOne.should_receive(:setup).
187
+ with(:vehicle, Manufacturer, {}).
188
+ and_return(@relationship)
189
+
190
+ class Manufacturer
191
+ belongs_to(:vehicle).should == mock_relationship
192
+ end
193
+ end
194
+
195
+ it "should create a many-to-one association with options" do
196
+ DataMapper::Associations::ManyToOne.should_receive(:setup).
197
+ with(:vehicle, Manufacturer, { :class_name => 'Car' }).
198
+ and_return(@relationship)
199
+
200
+ class Manufacturer
201
+ belongs_to(:vehicle, :class_name => 'Car').should == mock_relationship
202
+ end
203
+ end
204
+ end
205
+ end
@@ -0,0 +1,110 @@
1
+ require 'pathname'
2
+ require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper'
3
+
4
+ require DataMapper.root / 'lib' / 'dm-core' / 'repository'
5
+ require DataMapper.root / 'lib' / 'dm-core' / 'resource'
6
+ require DataMapper.root / 'lib' / 'dm-core' / 'auto_migrations'
7
+
8
+ describe DataMapper::AutoMigrations do
9
+
10
+ before :all do
11
+ @cow = Class.new do
12
+ include DataMapper::Resource
13
+
14
+ property :name, String, :key => true
15
+ property :age, Integer
16
+ end
17
+ end
18
+
19
+ before(:each) do
20
+ DataMapper::Resource.descendants.clear
21
+ end
22
+
23
+ after(:each) do
24
+ DataMapper::Resource.descendants.clear
25
+ end
26
+
27
+ it "should add the resource class to AutoMigrator's models on a mixin" do
28
+ @class = Class.new do
29
+ include DataMapper::Resource
30
+ end
31
+
32
+ DataMapper::Resource.descendants.should include(@class)
33
+ end
34
+
35
+ it "should add the #auto_migrate! method on a mixin" do
36
+ @cat = Class.new do
37
+ include DataMapper::Resource
38
+
39
+ property :name, String, :key => true
40
+ property :age, Integer
41
+ end
42
+
43
+ @cat.should respond_to(:auto_migrate!)
44
+ end
45
+
46
+ it "should add the #auto_upgrade! method on a mixin" do
47
+ @cat = Class.new do
48
+ include DataMapper::Resource
49
+
50
+ property :name, String, :key => true
51
+ property :age, Integer
52
+ end
53
+
54
+ @cat.should respond_to(:auto_upgrade!)
55
+ end
56
+
57
+ it "should not conflict with other Migrators on a mixin" do
58
+ migrator_class = Class.new(DataMapper::Migrator)
59
+
60
+ included_proc = lambda { |model| migrator_class.models << model }
61
+
62
+ migrator_mixin = Module.new do
63
+ self.class.send(:define_method, :included, &included_proc)
64
+ end
65
+
66
+ model_class = Class.new do
67
+ include DataMapper::Resource
68
+ include migrator_mixin
69
+
70
+ property :name, String
71
+ property :age, String
72
+ end
73
+
74
+ DataMapper::Resource.descendants.should include(model_class)
75
+ migrator_class.models.should include(model_class)
76
+ end
77
+
78
+ describe "#auto_migrate" do
79
+ before do
80
+ @repository_name = mock('repository name')
81
+ end
82
+
83
+ it "should call each model's auto_migrate! method" do
84
+ models = [:cat, :dog, :fish, :cow].map {|m| mock(m)}
85
+
86
+ models.each do |model|
87
+ DataMapper::Resource.descendants << model
88
+ model.should_receive(:auto_migrate!).with(@repository_name)
89
+ end
90
+
91
+ DataMapper::AutoMigrator.auto_migrate(@repository_name)
92
+ end
93
+ end
94
+ describe "#auto_upgrade" do
95
+ before do
96
+ @repository_name = mock('repository name')
97
+ end
98
+
99
+ it "should call each model's auto_upgrade! method" do
100
+ models = [:cat, :dog, :fish, :cow].map {|m| mock(m)}
101
+
102
+ models.each do |model|
103
+ DataMapper::Resource.descendants << model
104
+ model.should_receive(:auto_upgrade!).with(@repository_name)
105
+ end
106
+
107
+ DataMapper::AutoMigrator.auto_upgrade(@repository_name)
108
+ end
109
+ end
110
+ end
@@ -0,0 +1,174 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
2
+
3
+ # ensure the Collection is extremely similar to an Array
4
+ # since it will be returned by Respository#all to return
5
+ # multiple resources to the caller
6
+ describe DataMapper::Collection do
7
+ before do
8
+ @property = mock('property')
9
+ @model = mock('model', :inheritance_property => [ @property ], :key => [ @property ])
10
+ @query = mock('query', :kind_of? => true, :fields => [ @property ], :model => @model)
11
+
12
+ @collection = DataMapper::Collection.new(@query) {}
13
+ end
14
+
15
+ it 'should provide #<<' do
16
+ @collection.should respond_to(:<<)
17
+ end
18
+
19
+ it 'should provide #all' do
20
+ @collection.should respond_to(:all)
21
+ end
22
+
23
+ it 'should provide #at' do
24
+ @collection.should respond_to(:at)
25
+ end
26
+
27
+ it 'should provide #clear' do
28
+ @collection.should respond_to(:clear)
29
+ end
30
+
31
+ it 'should provide #collect!' do
32
+ @collection.should respond_to(:collect!)
33
+ end
34
+
35
+ it 'should provide #concat' do
36
+ @collection.should respond_to(:concat)
37
+ end
38
+
39
+ it 'should provide #create' do
40
+ @collection.should respond_to(:create)
41
+ end
42
+
43
+ it 'should provide #delete' do
44
+ @collection.should respond_to(:delete)
45
+ end
46
+
47
+ it 'should provide #delete_at' do
48
+ @collection.should respond_to(:delete_at)
49
+ end
50
+
51
+ it 'should provide #destroy!' do
52
+ @collection.should respond_to(:destroy!)
53
+ end
54
+
55
+ it 'should provide #each' do
56
+ @collection.should respond_to(:each)
57
+ end
58
+
59
+ it 'should provide #each_index' do
60
+ @collection.should respond_to(:each_index)
61
+ end
62
+
63
+ it 'should provide #eql?' do
64
+ @collection.should respond_to(:eql?)
65
+ end
66
+
67
+ it 'should provide #fetch' do
68
+ @collection.should respond_to(:fetch)
69
+ end
70
+
71
+ it 'should provide #first' do
72
+ @collection.should respond_to(:first)
73
+ end
74
+
75
+ it 'should provide #get' do
76
+ @collection.should respond_to(:get)
77
+ end
78
+
79
+ it 'should provide #get!' do
80
+ @collection.should respond_to(:get!)
81
+ end
82
+
83
+ it 'should provide #insert' do
84
+ @collection.should respond_to(:insert)
85
+ end
86
+
87
+ it 'should provide #last' do
88
+ @collection.should respond_to(:last)
89
+ end
90
+
91
+ it 'should provide #load' do
92
+ @collection.should respond_to(:load)
93
+ end
94
+
95
+ it 'should provide #loaded?' do
96
+ @collection.should respond_to(:loaded?)
97
+ end
98
+
99
+ it 'should provide #pop' do
100
+ @collection.should respond_to(:pop)
101
+ end
102
+
103
+ it 'should provide #push' do
104
+ @collection.should respond_to(:push)
105
+ end
106
+
107
+ it 'should provide #properties' do
108
+ @collection.should respond_to(:properties)
109
+ end
110
+
111
+ it 'should provide #reject' do
112
+ @collection.should respond_to(:reject)
113
+ end
114
+
115
+ it 'should provide #reject!' do
116
+ @collection.should respond_to(:reject!)
117
+ end
118
+
119
+ it 'should provide #relationships' do
120
+ @collection.should respond_to(:relationships)
121
+ end
122
+
123
+ it 'should provide #reload' do
124
+ @collection.should respond_to(:reload)
125
+ end
126
+
127
+ it 'should provide #reverse' do
128
+ @collection.should respond_to(:reverse)
129
+ end
130
+
131
+ it 'should provide #reverse!' do
132
+ @collection.should respond_to(:reverse!)
133
+ end
134
+
135
+ it 'should provide #reverse_each' do
136
+ @collection.should respond_to(:reverse_each)
137
+ end
138
+
139
+ it 'should provide #select' do
140
+ @collection.should respond_to(:select)
141
+ end
142
+
143
+ it 'should provide #shift' do
144
+ @collection.should respond_to(:shift)
145
+ end
146
+
147
+ it 'should provide #slice' do
148
+ @collection.should respond_to(:slice)
149
+ end
150
+
151
+ it 'should provide #slice!' do
152
+ @collection.should respond_to(:slice!)
153
+ end
154
+
155
+ it 'should provide #sort' do
156
+ @collection.should respond_to(:sort)
157
+ end
158
+
159
+ it 'should provide #sort!' do
160
+ @collection.should respond_to(:sort!)
161
+ end
162
+
163
+ it 'should provide #unshift' do
164
+ @collection.should respond_to(:unshift)
165
+ end
166
+
167
+ it 'should provide #update!' do
168
+ @collection.should respond_to(:update!)
169
+ end
170
+
171
+ it 'should provide #values_at' do
172
+ @collection.should respond_to(:values_at)
173
+ end
174
+ end