mongoid-minitest 0.1.5 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +18 -0
- data/.travis.yml +12 -0
- data/CHANGELOG.md +79 -2
- data/Gemfile +3 -0
- data/Gemfile.edge +6 -0
- data/{LICENSE → LICENSE.md} +1 -1
- data/README.md +46 -53
- data/Rakefile +13 -0
- data/lib/matchers/associations/associations.rb +20 -20
- data/lib/matchers/document/be_stored_in.rb +4 -4
- data/lib/matchers/document/document.rb +9 -7
- data/lib/matchers/document/have_field.rb +12 -13
- data/lib/matchers/document/have_index.rb +4 -4
- data/lib/matchers/matcher.rb +1 -3
- data/lib/mongoid-minitest.rb +2 -15
- data/mongoid-minitest.gemspec +28 -0
- data/test/matchers/associations_test.rb +32 -0
- data/test/matchers/document_test.rb +28 -0
- data/test/models/models.rb +48 -0
- data/test/test_helper.rb +15 -0
- metadata +49 -26
- data/lib/matchers/helpers.rb +0 -13
- data/lib/matchers/validations/acceptance.rb +0 -47
- data/lib/matchers/validations/associated.rb +0 -19
- data/lib/matchers/validations/confirmation.rb +0 -9
- data/lib/matchers/validations/exclusion.rb +0 -52
- data/lib/matchers/validations/format.rb +0 -65
- data/lib/matchers/validations/inclusion.rb +0 -52
- data/lib/matchers/validations/length.rb +0 -86
- data/lib/matchers/validations/presence.rb +0 -9
- data/lib/matchers/validations/uniqueness.rb +0 -64
- data/lib/matchers/validations/validations.rb +0 -91
- data/lib/mongoid-minitest/version.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8eebdad8b5b9c67d775c9a7b274d277c04685f29
|
4
|
+
data.tar.gz: edc782fd5cea7937ffaff2a0eb1458934dab5015
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ca707f22905c2e26a37bbf768a6ba0700df1ba2186470db9187fd555ebf877e1310385a46a9bd498edb54526e0c0b7e29e5dfcc7a35261df827007d90e67196
|
7
|
+
data.tar.gz: 36c28d586589aaa40dad9a230b890cd71de33d6dde6c11f4c8af753b85c0399509bbdee21abf97fc95b6f956b3b914e22a764b603eaece40f52be57f3090b070
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,23 +1,49 @@
|
|
1
|
+
## 1.0.0 - February 27, 2013
|
2
|
+
|
3
|
+
+ Extract Validation Matchers to [minitest-activemodel](https://github.com/frodsan/minitest-activemodel) gem.
|
4
|
+
|
5
|
+
Breaking changes:
|
6
|
+
|
7
|
+
+ `validate_format_of(:email).to_allow(/\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/)` is not supported.
|
8
|
+
Use `validate_format_of(:email).to_allow('frodsan@me.com')` instead.
|
9
|
+
|
10
|
+
*Francesco Rodriguez*
|
11
|
+
|
12
|
+
+ Add support for JRuby 1.9 mode - *Francesco Rodriguez*.
|
13
|
+
|
14
|
+
+ Add support for Ruby 2.0.0, ruby-head and rbx-19mode - *Francesco Rodriguez*.
|
15
|
+
|
16
|
+
+ Add support for Mongoid 4 edge - *Francesco Rodriguez*.
|
17
|
+
|
18
|
+
+ Remove instance variable warnings.
|
19
|
+
Pull Request [#17](https://github.com/frodsan/mongoid-minitest/pull/17) - *Ryan McGeary*.
|
20
|
+
|
1
21
|
## 0.1.5 - February 26, 2013
|
2
22
|
|
3
23
|
+ Add Ruby 2.0.0 support - *Francesco Rodriguez*.
|
24
|
+
|
4
25
|
+ Make mongoid version more flexible in gemspec.
|
5
26
|
Pull Request [#16](https://github.com/frodsan/mongoid-minitest/pull/16) - *Ryan McGeary*.
|
27
|
+
|
6
28
|
+ Add compound indexes support for `have_index` matcher.
|
7
29
|
Pull Request [#15](https://github.com/frodsan/mongoid-minitest/pull/15) - *Ryan McGeary*.
|
30
|
+
|
8
31
|
+ Remove support for automatically appending `_id` to fields passed to
|
9
32
|
`have_index` matcher. See <https://github.com/frodsan/mongoid-minitest/pull/15#issuecomment-11851098>
|
10
|
-
|
33
|
+
for more information - *Ryan McGeary*.
|
11
34
|
|
12
35
|
## 0.1.4 - October 10, 2012
|
13
36
|
|
14
37
|
+ Bump mongoid version to 3.0.6 - *Francesco Rodriguez*.
|
38
|
+
|
15
39
|
+ Bump minitest version to >= 4.0.0 - *Francesco Rodriguez*.
|
16
40
|
|
17
41
|
## 0.1.3 - September 8, 2012
|
18
42
|
|
19
43
|
+ Bump mongoid version to 3.0.5 - *Francesco Rodriguez*.
|
44
|
+
|
20
45
|
+ Bump minitest version to 3.4.0 - *Francesco Rodriguez*.
|
46
|
+
|
21
47
|
+ Added on option for validation matchers.
|
22
48
|
Pull Request [#14](https://github.com/frodsan/mongoid-minitest/pull/14) - *Godfrey Chan*.
|
23
49
|
|
@@ -25,12 +51,16 @@
|
|
25
51
|
|
26
52
|
+ Allow passing in a Regex to the validate_format_of matcher.
|
27
53
|
Pull Request [#12](https://github.com/frodsan/mongoid-minitest/pull/12) - *Godfrey Chan*.
|
54
|
+
|
28
55
|
+ Allow non-array values for inclusion/exclusion matchers.
|
29
56
|
Pull Request [#11](https://github.com/frodsan/mongoid-minitest/pull/11) - *Godfrey Chan*.
|
57
|
+
|
30
58
|
+ Added as_inverse_of for association matchers.
|
31
59
|
Pull Request [#10](https://frodsan/mongoid-minitest/pull/10) - *Godfrey Chan*.
|
60
|
+
|
32
61
|
+ Use [minitest-matchers](https://github.com/zenspider/minitest-matchers) gem
|
33
62
|
instead of our matchers implementation - *Francesco Rodriguez*.
|
63
|
+
|
34
64
|
+ Bump mongoid version to 3.0.4 - *Francesco Rodriguez*.
|
35
65
|
|
36
66
|
## 0.1.1 - August 09, 2012
|
@@ -40,6 +70,7 @@
|
|
40
70
|
## 0.1.0 - August 09, 2012
|
41
71
|
|
42
72
|
+ Change support to only Ruby 1.9.3.
|
73
|
+
|
43
74
|
+ Bump mongoid version to 3.0.2 and minitest version to 3.3.0 and minitest version
|
44
75
|
to 3.3.0 - *Sascha Wessel*.
|
45
76
|
|
@@ -51,57 +82,103 @@
|
|
51
82
|
## 0.0.3 - April 15, 2012
|
52
83
|
|
53
84
|
+ Add `have_index_for(indexed_field)` document matcher.
|
85
|
+
|
54
86
|
+ Add `embedded_in(association_name)` association matcher.
|
87
|
+
|
55
88
|
+ Add `embed_many(association_name)` association matcher.
|
89
|
+
|
56
90
|
+ Fix issue check `association_type` if metadata is not nil.
|
91
|
+
|
57
92
|
+ Add `embed_one(association_name)` association matcher.
|
93
|
+
|
58
94
|
+ Add `have_and_belong_to_many(association_name)` association matcher.
|
95
|
+
|
59
96
|
+ Add `validate_associated(association_name)` validation matcher.
|
97
|
+
|
60
98
|
+ Add `accept_with(value)` chain matcher to `validate_acceptance_of`.
|
99
|
+
|
61
100
|
+ Add `validate_acceptance_of(field)` validation matcher.
|
101
|
+
|
62
102
|
+ Add `validate_confirmation_of(field)` validation matcher.
|
63
103
|
|
64
|
-
##
|
104
|
+
## 0.0.2 - April 13, 2012
|
65
105
|
|
66
106
|
+ Add `have_one(association_name)` association matcher.
|
107
|
+
|
67
108
|
+ Add `in(range)` alias to `within` matcher.
|
109
|
+
|
68
110
|
+ Add `within(range)` chain matcher to `validate_length_of`.
|
111
|
+
|
69
112
|
+ Add `scoped_to(*scope)` chain matcher to `validate_uniqueness_of`
|
113
|
+
|
70
114
|
+ Add `with_message(custom_message)` chain matcher for validation matchers to test
|
71
115
|
custom messages.
|
116
|
+
|
72
117
|
+ Add `DocumentModuleMatcher` class to simplify document matchers.
|
118
|
+
|
73
119
|
+ Add `be_stored_in(collection_name)` document matcher.
|
120
|
+
|
74
121
|
+ Add `to_allow(values)` chain matcher to `validate_inclusion_of`.
|
122
|
+
|
75
123
|
+ Add `validate_inclusion_of(field)` validation matcher.
|
124
|
+
|
76
125
|
+ Add `belong_to(association_name)` association matcher.
|
77
126
|
|
127
|
+
|
78
128
|
## 0.0.1 - April 12, 2012
|
79
129
|
|
80
130
|
+ Add `of_type(type)` chain matcher to association matcher.
|
131
|
+
|
81
132
|
+ Add `have_many(association_name)` association matcher.
|
133
|
+
|
82
134
|
+ Add `Mongoid::Matchers::Associations` module.
|
135
|
+
|
83
136
|
+ Add `to_not_allow(*values)` chain matcher to `validate_exclusion_of`.
|
137
|
+
|
84
138
|
+ Add `validate_exclusion_of(field)` validation matcher.
|
139
|
+
|
85
140
|
+ Add `to_not_allow(*values)` matcher to `validate_format_of`.
|
141
|
+
|
86
142
|
+ Add `to_allow(*values)` matcher to `validate_format_of`.
|
143
|
+
|
87
144
|
+ Add `validate_format_of(field)` validation matcher.
|
145
|
+
|
88
146
|
+ Add `with_max(value)` alias to `with_maximum` matcher.
|
147
|
+
|
89
148
|
+ Add `with_maximum(value)` chain matcher to `validate_length_of`
|
149
|
+
|
90
150
|
+ Add `with_min(value)` alias to `with_minimum` matcher.
|
151
|
+
|
91
152
|
+ Add `with_minimum(value)` matcher to `validate_length_of`.
|
153
|
+
|
92
154
|
+ Add `validate_length_of(field)` validation matcher.
|
155
|
+
|
93
156
|
+ Add `case_sensitive` chain matcher to `validate_uniqueness_of`.
|
157
|
+
|
94
158
|
+ Add `validate_uniqueness_of(field)` validation matcher.
|
159
|
+
|
95
160
|
+ Add `validate_presence_of(field)` validation matcher.
|
161
|
+
|
96
162
|
+ Add `have_fields(*fields)` document matcher.
|
163
|
+
|
97
164
|
+ Add `be_timestamped` document matcher.
|
165
|
+
|
98
166
|
+ Add `be_versioned` document matcher.
|
167
|
+
|
99
168
|
+ Add `be_paranoid` document matcher.
|
169
|
+
|
100
170
|
+ Add `be_document` document matcher.
|
171
|
+
|
101
172
|
+ Add `with_default_value(default)` chain matcher to `have_field`.
|
173
|
+
|
102
174
|
+ Add `of_type(type)` chain matcher to `have_field`.
|
175
|
+
|
103
176
|
+ Add `must` and `wont` methods to `MiniTest::Spec`.
|
177
|
+
|
104
178
|
+ Add `have_field(field)` document matcher.
|
179
|
+
|
105
180
|
+ Add default failure messages based on description matcher.
|
181
|
+
|
106
182
|
+ Add `must` and `wont` expectations.
|
183
|
+
|
107
184
|
+ Add `assert_must` and `assert_wont` to `MiniTest::Assertions`.
|
data/Gemfile
ADDED
data/Gemfile.edge
ADDED
data/{LICENSE → LICENSE.md}
RENAMED
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
19
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
20
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
21
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,24 +1,29 @@
|
|
1
|
-
|
1
|
+
mongoid-minitest
|
2
|
+
================
|
2
3
|
|
3
4
|
MiniTest matchers for Mongoid.
|
4
5
|
|
5
6
|
[![Build Status](https://secure.travis-ci.org/frodsan/mongoid-minitest.png?branch=master&.png)](http://travis-ci.org/frodsan/mongoid-minitest)
|
7
|
+
[![Dependency Status](https://gemnasium.com/frodsan/mongoid-minitest.png)](https://gemnasium.com/frodsan/mongoid-minitest)
|
8
|
+
[![Code Climate](https://codeclimate.com/github/frodsan/mongoid-minitest.png)](https://codeclimate.com/github/frodsan/mongoid-minitest)
|
6
9
|
|
7
|
-
|
10
|
+
Support
|
11
|
+
-------
|
8
12
|
|
9
13
|
This gem supports:
|
10
14
|
|
11
|
-
* Ruby 1.9.3, 2.0.0
|
12
|
-
* Mongoid ~>3.0
|
13
|
-
* MiniTest ~>4.1
|
15
|
+
* Ruby 1.9.3, 2.0.0, ruby-head, rbx-19mode, jruby-19mode.
|
16
|
+
* Mongoid ~>3.0, Mongoid 4.0 edge (Use mongoid/mongoid Github repository).
|
17
|
+
* MiniTest ~>4.1.
|
14
18
|
|
15
|
-
|
19
|
+
**NOTE:** Version 2.0.x will remove support for Mongoid 3.x.
|
16
20
|
|
17
|
-
|
21
|
+
Installation
|
22
|
+
------------
|
18
23
|
|
19
24
|
Add this line to your application's Gemfile:
|
20
25
|
|
21
|
-
gem 'mongoid-minitest'
|
26
|
+
gem 'mongoid-minitest', group: :test
|
22
27
|
|
23
28
|
And then execute:
|
24
29
|
|
@@ -28,7 +33,15 @@ Or install it yourself as:
|
|
28
33
|
|
29
34
|
$ gem install mongoid-minitest
|
30
35
|
|
31
|
-
|
36
|
+
Usage
|
37
|
+
-----
|
38
|
+
|
39
|
+
Require `mongoid-minitest` in your `test_helper.rb` or
|
40
|
+
`spec_helper.rb` file:
|
41
|
+
|
42
|
+
require 'minitest/autorun'
|
43
|
+
require 'mongoid'
|
44
|
+
require 'mongoid-minitest'
|
32
45
|
|
33
46
|
Matchers are available at `Mongoid::Matchers` module.
|
34
47
|
Setup matchers according to your testing preference:
|
@@ -69,29 +82,33 @@ See the following examples:
|
|
69
82
|
it { wont have_field(:none) }
|
70
83
|
end
|
71
84
|
|
72
|
-
|
85
|
+
Matchers
|
86
|
+
--------
|
73
87
|
|
74
88
|
`Mongoid::Matchers` include the following modules:
|
75
89
|
|
76
90
|
Module Mongoid
|
77
91
|
Module Matchers
|
78
92
|
include Document
|
79
|
-
include Validations
|
80
93
|
include Associations
|
94
|
+
include MiniTest::Matchers::ActiveModel
|
81
95
|
end
|
82
96
|
end
|
83
97
|
|
98
|
+
**NOTE:** [minitest-activemodel](https://github.com/frodsan/minitest-activemodel)
|
99
|
+
gem is a dependency of this gem.
|
100
|
+
|
84
101
|
### Document Matchers
|
85
102
|
|
86
103
|
describe Mongoid::Matchers::Document do
|
87
104
|
subject { Person }
|
88
105
|
|
89
106
|
it { must be_document } # if model includes Mongoid::Document
|
90
|
-
it { must be_paranoid } # if model includes Mongoid::Paranoia
|
91
|
-
it { must be_versioned } # if model includes Mongoid::Versioning
|
107
|
+
it { must be_paranoid } # if model includes Mongoid::Paranoia (Only in Mongoid <= 4.0.0)
|
108
|
+
it { must be_versioned } # if model includes Mongoid::Versioning (Only in Mongoid <= 4.0.0)
|
92
109
|
it { must be_timestamped } # if model includes Mongoid::Timestamps
|
93
110
|
|
94
|
-
it
|
111
|
+
it { must be_stored_in(:people) } # checks the collection for model's document
|
95
112
|
|
96
113
|
it { must have_field(:name) }
|
97
114
|
it { must have_field(:name).of_type(String) }
|
@@ -107,40 +124,6 @@ See the following examples:
|
|
107
124
|
it { must have_index_for(:account_id, :email) }
|
108
125
|
end
|
109
126
|
|
110
|
-
### Validation Matchers
|
111
|
-
|
112
|
-
describe Mongoid::Matchers::Validations do
|
113
|
-
subject { Person }
|
114
|
-
|
115
|
-
it { must validate_presence_of(:name) }
|
116
|
-
|
117
|
-
it { must validate_uniqueness_of(:login).case_insensitive }
|
118
|
-
it { must validate_uniqueness_of(:login).scoped_to(:site) }
|
119
|
-
|
120
|
-
it { must validate_length_of(:login).in(5..12) }
|
121
|
-
it { must validate_length_of(:login).within(5..12) }
|
122
|
-
|
123
|
-
it { must validate_length_of(:password).with_min(8) }
|
124
|
-
it { must validate_length_of(:password).with_minimum(8) }
|
125
|
-
it { must validate_length_of(:password).with_max(16) }
|
126
|
-
it { must validate_length_of(:password).with_maximum(16) }
|
127
|
-
|
128
|
-
it { must validate_format_of(:email).to_allow("foo@bar.com") }
|
129
|
-
it { must validate_format_of(:email).to_not_allow("foo_bar_com") }
|
130
|
-
|
131
|
-
it { must validate_inclusion_of(:role).to_allow("user", "admin") }
|
132
|
-
it { must validate_exclusion_of(:email).to_not_allow("foo@bar.com", "fizz@buzz.com") }
|
133
|
-
|
134
|
-
it { must validate_confirmation_of(:password) }
|
135
|
-
it { must validate_acceptance_of(:terms_of_use).accept_with("1") }
|
136
|
-
|
137
|
-
it { must validate_associated(:pets) }
|
138
|
-
|
139
|
-
# Testing validators custom messages
|
140
|
-
it { must validate_presence_of(:role).with_message("no role") }
|
141
|
-
it { must validate_length_of(:password).with_min(8).with_message("len >= 8") }
|
142
|
-
end
|
143
|
-
|
144
127
|
### Association Matchers
|
145
128
|
|
146
129
|
describe Mongoid::Matchers::Associations do
|
@@ -168,7 +151,13 @@ See the following examples:
|
|
168
151
|
end
|
169
152
|
end
|
170
153
|
|
171
|
-
|
154
|
+
### Validation Matchers
|
155
|
+
|
156
|
+
Check [minitest-activemodel](https://github.com/frodsan/minitest-activemodel)
|
157
|
+
gem for more information.
|
158
|
+
|
159
|
+
Contributing
|
160
|
+
------------
|
172
161
|
|
173
162
|
1. Fork it.
|
174
163
|
2. Create your feature branch (`git checkout -b my-new-feature`).
|
@@ -176,17 +165,21 @@ See the following examples:
|
|
176
165
|
4. Push to the branch (`git push origin my-new-feature`).
|
177
166
|
5. Create new Pull Request.
|
178
167
|
|
179
|
-
|
168
|
+
Unit Tests
|
169
|
+
----------
|
180
170
|
|
181
|
-
To run unit tests, run `
|
171
|
+
To run unit tests, run `rake test`.
|
182
172
|
|
183
|
-
|
173
|
+
Maintainers
|
174
|
+
-----------
|
184
175
|
|
185
176
|
* Francesco Rodriguez (https://github.com/frodsan/).
|
186
177
|
* Sascha Wessel (https://github.com/gr4y).
|
187
178
|
* Godfrey Chan (https://github.com/chancancode).
|
179
|
+
* Ryan McGeary (https://github.com/rmm5t).
|
188
180
|
|
189
|
-
|
181
|
+
License
|
182
|
+
-------
|
190
183
|
|
191
184
|
MIT License. Copyright 2012 Francesco Rodriguez. See [LICENSE](https://github.com/frodsan/lego/blob/master/LICENSE)
|
192
185
|
for more information.
|
data/Rakefile
ADDED
@@ -10,27 +10,27 @@ module Mongoid
|
|
10
10
|
EMBEDDED_IN = Mongoid::Relations::Embedded::In
|
11
11
|
|
12
12
|
class HaveAssociationMatcher < Matcher
|
13
|
-
def initialize
|
13
|
+
def initialize name, type
|
14
14
|
@association = {}
|
15
15
|
@association[:name] = name.to_s
|
16
16
|
@association[:type] = type
|
17
17
|
@description = "#{type_description} #{@association[:name].inspect}"
|
18
18
|
end
|
19
19
|
|
20
|
-
def of_type
|
20
|
+
def of_type klass
|
21
21
|
@association[:class] = klass
|
22
22
|
@description << " of type #{@association[:class].inspect}"
|
23
23
|
self
|
24
24
|
end
|
25
25
|
|
26
|
-
def as_inverse_of
|
26
|
+
def as_inverse_of inverse_of
|
27
27
|
@association[:inverse_of] = inverse_of
|
28
28
|
@description << " as the inverse of #{@association[:inverse_of].inspect}"
|
29
29
|
self
|
30
30
|
end
|
31
31
|
|
32
|
-
def matches?
|
33
|
-
@klass = class_of
|
32
|
+
def matches? subject
|
33
|
+
@klass = class_of subject
|
34
34
|
@metadata = @klass.relations[@association[:name]]
|
35
35
|
@result = true
|
36
36
|
|
@@ -96,7 +96,7 @@ module Mongoid
|
|
96
96
|
end
|
97
97
|
end
|
98
98
|
|
99
|
-
def type_description
|
99
|
+
def type_description type = nil, passive = true
|
100
100
|
type ||= @association[:type]
|
101
101
|
case type.name
|
102
102
|
when HAS_ONE.name
|
@@ -119,32 +119,32 @@ module Mongoid
|
|
119
119
|
end
|
120
120
|
end
|
121
121
|
|
122
|
-
def have_one
|
123
|
-
HaveAssociationMatcher.new
|
122
|
+
def have_one association_name
|
123
|
+
HaveAssociationMatcher.new association_name, HAS_ONE
|
124
124
|
end
|
125
125
|
|
126
|
-
def have_many
|
127
|
-
HaveAssociationMatcher.new
|
126
|
+
def have_many association_name
|
127
|
+
HaveAssociationMatcher.new association_name, HAS_MANY
|
128
128
|
end
|
129
129
|
|
130
|
-
def have_and_belong_to_many
|
131
|
-
HaveAssociationMatcher.new
|
130
|
+
def have_and_belong_to_many association_name
|
131
|
+
HaveAssociationMatcher.new association_name, HAS_AND_BELONGS_TO_MANY
|
132
132
|
end
|
133
133
|
|
134
|
-
def belong_to
|
135
|
-
HaveAssociationMatcher.new
|
134
|
+
def belong_to association_name
|
135
|
+
HaveAssociationMatcher.new association_name, BELONGS_TO
|
136
136
|
end
|
137
137
|
|
138
|
-
def embed_one
|
139
|
-
HaveAssociationMatcher.new
|
138
|
+
def embed_one association_name
|
139
|
+
HaveAssociationMatcher.new association_name, EMBEDS_ONE
|
140
140
|
end
|
141
141
|
|
142
|
-
def embed_many
|
143
|
-
HaveAssociationMatcher.new
|
142
|
+
def embed_many association_name
|
143
|
+
HaveAssociationMatcher.new association_name, EMBEDS_MANY
|
144
144
|
end
|
145
145
|
|
146
|
-
def embedded_in
|
147
|
-
HaveAssociationMatcher.new
|
146
|
+
def embedded_in association_name
|
147
|
+
HaveAssociationMatcher.new association_name, EMBEDDED_IN
|
148
148
|
end
|
149
149
|
end
|
150
150
|
end
|