shoulda-matchers 1.4.2 → 1.5.0
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.
- data/.travis.yml +11 -3
- data/Appraisals +3 -3
- data/Gemfile +1 -1
- data/Gemfile.lock +69 -70
- data/MIT-LICENSE +1 -1
- data/NEWS.md +22 -4
- data/README.md +3 -1
- data/Rakefile +9 -5
- data/features/step_definitions/rails_steps.rb +7 -7
- data/features/support/env.rb +1 -1
- data/gemfiles/3.0.gemfile +1 -1
- data/gemfiles/3.0.gemfile.lock +25 -22
- data/gemfiles/3.1.gemfile +1 -1
- data/gemfiles/3.1.gemfile.lock +27 -24
- data/gemfiles/3.2.gemfile +1 -1
- data/gemfiles/3.2.gemfile.lock +56 -52
- data/lib/shoulda/matchers/action_controller.rb +3 -2
- data/lib/shoulda/matchers/action_controller/assign_to_matcher.rb +10 -8
- data/lib/shoulda/matchers/action_controller/filter_param_matcher.rb +2 -4
- data/lib/shoulda/matchers/action_controller/redirect_to_matcher.rb +3 -4
- data/lib/shoulda/matchers/action_controller/render_template_matcher.rb +3 -4
- data/lib/shoulda/matchers/action_controller/render_with_layout_matcher.rb +6 -6
- data/lib/shoulda/matchers/action_controller/respond_with_content_type_matcher.rb +5 -2
- data/lib/shoulda/matchers/action_controller/respond_with_matcher.rb +2 -2
- data/lib/shoulda/matchers/action_controller/route_matcher.rb +12 -12
- data/lib/shoulda/matchers/action_controller/set_session_matcher.rb +3 -4
- data/lib/shoulda/matchers/action_controller/set_the_flash_matcher.rb +10 -11
- data/lib/shoulda/matchers/action_controller/strong_parameters_matcher.rb +121 -0
- data/lib/shoulda/matchers/action_mailer/have_sent_email_matcher.rb +7 -4
- data/lib/shoulda/matchers/active_model.rb +1 -1
- data/lib/shoulda/matchers/active_model/allow_mass_assignment_of_matcher.rb +8 -8
- data/lib/shoulda/matchers/active_model/allow_value_matcher.rb +5 -4
- data/lib/shoulda/matchers/active_model/disallow_value_matcher.rb +3 -3
- data/lib/shoulda/matchers/active_model/ensure_inclusion_of_matcher.rb +2 -2
- data/lib/shoulda/matchers/active_model/exception_message_finder.rb +0 -1
- data/lib/shoulda/matchers/active_model/helpers.rb +16 -7
- data/lib/shoulda/matchers/active_model/only_integer_matcher.rb +3 -3
- data/lib/shoulda/matchers/active_model/validate_confirmation_of_matcher.rb +8 -6
- data/lib/shoulda/matchers/active_model/validate_format_of_matcher.rb +19 -10
- data/lib/shoulda/matchers/active_model/validate_numericality_of_matcher.rb +4 -4
- data/lib/shoulda/matchers/active_model/validate_uniqueness_of_matcher.rb +19 -21
- data/lib/shoulda/matchers/active_model/validation_matcher.rb +7 -7
- data/lib/shoulda/matchers/active_model/validation_message_finder.rb +1 -1
- data/lib/shoulda/matchers/active_record/accept_nested_attributes_for_matcher.rb +5 -5
- data/lib/shoulda/matchers/active_record/association_matcher.rb +3 -3
- data/lib/shoulda/matchers/active_record/have_db_column_matcher.rb +11 -7
- data/lib/shoulda/matchers/active_record/have_db_index_matcher.rb +2 -2
- data/lib/shoulda/matchers/active_record/have_readonly_attribute_matcher.rb +5 -5
- data/lib/shoulda/matchers/active_record/query_the_database_matcher.rb +5 -2
- data/lib/shoulda/matchers/active_record/serialize_matcher.rb +3 -3
- data/lib/shoulda/matchers/assertion_error.rb +4 -1
- data/lib/shoulda/matchers/independent/delegate_matcher.rb +17 -7
- data/lib/shoulda/matchers/integrations/rspec.rb +19 -33
- data/lib/shoulda/matchers/version.rb +1 -1
- data/shoulda-matchers.gemspec +6 -4
- data/spec/shoulda/matchers/action_controller/assign_to_matcher_spec.rb +66 -0
- data/spec/shoulda/matchers/action_controller/filter_param_matcher_spec.rb +22 -0
- data/spec/shoulda/matchers/action_controller/redirect_to_matcher_spec.rb +42 -0
- data/spec/shoulda/matchers/action_controller/render_template_matcher_spec.rb +78 -0
- data/spec/shoulda/matchers/action_controller/render_with_layout_matcher_spec.rb +58 -0
- data/spec/shoulda/matchers/action_controller/respond_with_content_type_matcher_spec.rb +31 -0
- data/spec/shoulda/matchers/action_controller/respond_with_matcher_spec.rb +31 -0
- data/spec/shoulda/matchers/action_controller/route_matcher_spec.rb +65 -0
- data/spec/shoulda/matchers/action_controller/set_session_matcher_spec.rb +51 -0
- data/spec/shoulda/matchers/action_controller/set_the_flash_matcher_spec.rb +153 -0
- data/spec/shoulda/matchers/action_controller/strong_parameters_matcher_spec.rb +142 -0
- data/spec/shoulda/matchers/action_mailer/have_sent_email_spec.rb +324 -0
- data/spec/shoulda/matchers/active_model/allow_mass_assignment_of_matcher_spec.rb +111 -0
- data/spec/shoulda/matchers/active_model/allow_value_matcher_spec.rb +124 -0
- data/spec/shoulda/matchers/active_model/disallow_value_matcher_spec.rb +43 -0
- data/spec/shoulda/matchers/active_model/ensure_exclusion_of_matcher_spec.rb +74 -0
- data/spec/shoulda/matchers/active_model/ensure_inclusion_of_matcher_spec.rb +171 -0
- data/spec/shoulda/matchers/active_model/ensure_length_of_matcher_spec.rb +113 -0
- data/spec/shoulda/{active_model → matchers/active_model}/exception_message_finder_spec.rb +2 -2
- data/spec/shoulda/matchers/active_model/helpers_spec.rb +158 -0
- data/spec/shoulda/matchers/active_model/only_integer_matcher_spec.rb +52 -0
- data/spec/shoulda/matchers/active_model/validate_acceptance_of_matcher_spec.rb +41 -0
- data/spec/shoulda/matchers/active_model/validate_confirmation_of_matcher_spec.rb +41 -0
- data/spec/shoulda/matchers/active_model/validate_format_of_matcher_spec.rb +75 -0
- data/spec/shoulda/matchers/active_model/validate_numericality_of_matcher_spec.rb +73 -0
- data/spec/shoulda/matchers/active_model/validate_presence_of_matcher_spec.rb +127 -0
- data/spec/shoulda/matchers/active_model/validate_uniqueness_of_matcher_spec.rb +175 -0
- data/spec/shoulda/{active_model → matchers/active_model}/validation_message_finder_spec.rb +0 -1
- data/spec/shoulda/matchers/active_record/accept_nested_attributes_for_matcher_spec.rb +106 -0
- data/spec/shoulda/matchers/active_record/association_matcher_spec.rb +534 -0
- data/spec/shoulda/matchers/active_record/have_db_column_matcher_spec.rb +111 -0
- data/spec/shoulda/matchers/active_record/have_db_index_matcher_spec.rb +78 -0
- data/spec/shoulda/matchers/active_record/have_readonly_attributes_matcher_spec.rb +41 -0
- data/spec/shoulda/{active_record → matchers/active_record}/query_the_database_matcher_spec.rb +10 -10
- data/spec/shoulda/matchers/active_record/serialize_matcher_spec.rb +86 -0
- data/spec/shoulda/{independent → matchers/independent}/delegate_matcher_spec.rb +55 -34
- data/spec/spec_helper.rb +1 -2
- data/spec/support/active_model_versions.rb +4 -0
- data/spec/support/activemodel_helpers.rb +19 -0
- data/spec/support/controller_builder.rb +38 -12
- data/spec/support/model_builder.rb +8 -2
- metadata +106 -98
- data/spec/fixtures/addresses.yml +0 -3
- data/spec/fixtures/friendships.yml +0 -0
- data/spec/fixtures/posts.yml +0 -5
- data/spec/fixtures/products.yml +0 -0
- data/spec/fixtures/taggings.yml +0 -0
- data/spec/fixtures/tags.yml +0 -9
- data/spec/fixtures/users.yml +0 -6
- data/spec/shoulda/action_controller/assign_to_matcher_spec.rb +0 -63
- data/spec/shoulda/action_controller/filter_param_matcher_spec.rb +0 -20
- data/spec/shoulda/action_controller/redirect_to_matcher_spec.rb +0 -40
- data/spec/shoulda/action_controller/render_template_matcher_spec.rb +0 -69
- data/spec/shoulda/action_controller/render_with_layout_matcher_spec.rb +0 -55
- data/spec/shoulda/action_controller/respond_with_content_type_matcher_spec.rb +0 -28
- data/spec/shoulda/action_controller/respond_with_matcher_spec.rb +0 -83
- data/spec/shoulda/action_controller/route_matcher_spec.rb +0 -65
- data/spec/shoulda/action_controller/set_session_matcher_spec.rb +0 -46
- data/spec/shoulda/action_controller/set_the_flash_matcher_spec.rb +0 -130
- data/spec/shoulda/action_mailer/have_sent_email_spec.rb +0 -333
- data/spec/shoulda/active_model/allow_mass_assignment_of_matcher_spec.rb +0 -115
- data/spec/shoulda/active_model/allow_value_matcher_spec.rb +0 -131
- data/spec/shoulda/active_model/disallow_value_matcher_spec.rb +0 -65
- data/spec/shoulda/active_model/ensure_exclusion_of_matcher_spec.rb +0 -79
- data/spec/shoulda/active_model/ensure_inclusion_of_matcher_spec.rb +0 -181
- data/spec/shoulda/active_model/ensure_length_of_matcher_spec.rb +0 -138
- data/spec/shoulda/active_model/helpers_spec.rb +0 -129
- data/spec/shoulda/active_model/only_integer_matcher_spec.rb +0 -69
- data/spec/shoulda/active_model/validate_acceptance_of_matcher_spec.rb +0 -43
- data/spec/shoulda/active_model/validate_confirmation_of_matcher_spec.rb +0 -48
- data/spec/shoulda/active_model/validate_format_of_matcher_spec.rb +0 -79
- data/spec/shoulda/active_model/validate_numericality_of_matcher_spec.rb +0 -112
- data/spec/shoulda/active_model/validate_presence_of_matcher_spec.rb +0 -135
- data/spec/shoulda/active_model/validate_uniqueness_of_matcher_spec.rb +0 -154
- data/spec/shoulda/active_record/accept_nested_attributes_for_matcher_spec.rb +0 -84
- data/spec/shoulda/active_record/association_matcher_spec.rb +0 -642
- data/spec/shoulda/active_record/have_db_column_matcher_spec.rb +0 -185
- data/spec/shoulda/active_record/have_db_index_matcher_spec.rb +0 -105
- data/spec/shoulda/active_record/have_readonly_attributes_matcher_spec.rb +0 -46
- data/spec/shoulda/active_record/serialize_matcher_spec.rb +0 -81
data/.travis.yml
CHANGED
@@ -1,13 +1,12 @@
|
|
1
|
+
script: "bundle exec rake spec cucumber"
|
2
|
+
|
1
3
|
rvm:
|
2
4
|
- 1.8.7
|
3
5
|
- 1.9.2
|
4
6
|
- 1.9.3
|
5
|
-
- ree
|
6
7
|
- rbx-18mode
|
7
8
|
- jruby
|
8
9
|
|
9
|
-
script: "bundle exec rake spec cucumber"
|
10
|
-
|
11
10
|
gemfile:
|
12
11
|
- gemfiles/3.0.gemfile
|
13
12
|
- gemfiles/3.1.gemfile
|
@@ -17,3 +16,12 @@ matrix:
|
|
17
16
|
allow_failures:
|
18
17
|
- rvm: rbx-18mode
|
19
18
|
- rvm: jruby
|
19
|
+
exclude:
|
20
|
+
- rvm: rbx-18mode
|
21
|
+
gemfile: gemfiles/3.0.gemfile
|
22
|
+
- rvm: rbx-18mode
|
23
|
+
gemfile: gemfiles/3.1.gemfile
|
24
|
+
- rvm: jruby
|
25
|
+
gemfile: gemfiles/3.0.gemfile
|
26
|
+
- rvm: jruby
|
27
|
+
gemfile: gemfiles/3.1.gemfile
|
data/Appraisals
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
appraise '3.0' do
|
2
|
-
gem 'rails', '3.0.17'
|
2
|
+
gem 'rails', '~> 3.0.17'
|
3
3
|
end
|
4
4
|
|
5
5
|
appraise '3.1' do
|
6
|
-
gem 'rails', '3.1.8'
|
6
|
+
gem 'rails', '~> 3.1.8'
|
7
7
|
gem 'jquery-rails'
|
8
8
|
gem 'sass-rails'
|
9
9
|
end
|
10
10
|
|
11
11
|
appraise '3.2' do
|
12
|
-
gem 'rails', '3.2.8'
|
12
|
+
gem 'rails', '~> 3.2.8'
|
13
13
|
gem 'jquery-rails'
|
14
14
|
gem 'sass-rails'
|
15
15
|
end
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,106 +1,100 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
shoulda-matchers (1.
|
4
|
+
shoulda-matchers (1.5.0)
|
5
5
|
activesupport (>= 3.0.0)
|
6
|
-
bourne (~> 1.
|
6
|
+
bourne (~> 1.2.0)
|
7
7
|
|
8
8
|
GEM
|
9
|
-
remote:
|
9
|
+
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
actionmailer (3.2.
|
12
|
-
actionpack (= 3.2.
|
11
|
+
actionmailer (3.2.9)
|
12
|
+
actionpack (= 3.2.9)
|
13
13
|
mail (~> 2.4.4)
|
14
|
-
actionpack (3.2.
|
15
|
-
activemodel (= 3.2.
|
16
|
-
activesupport (= 3.2.
|
14
|
+
actionpack (3.2.9)
|
15
|
+
activemodel (= 3.2.9)
|
16
|
+
activesupport (= 3.2.9)
|
17
17
|
builder (~> 3.0.0)
|
18
18
|
erubis (~> 2.7.0)
|
19
|
-
journey (~> 1.0.
|
19
|
+
journey (~> 1.0.4)
|
20
20
|
rack (~> 1.4.0)
|
21
21
|
rack-cache (~> 1.2)
|
22
22
|
rack-test (~> 0.6.1)
|
23
|
-
sprockets (~> 2.1
|
24
|
-
activemodel (3.2.
|
25
|
-
activesupport (= 3.2.
|
23
|
+
sprockets (~> 2.2.1)
|
24
|
+
activemodel (3.2.9)
|
25
|
+
activesupport (= 3.2.9)
|
26
26
|
builder (~> 3.0.0)
|
27
|
-
activerecord (3.2.
|
28
|
-
activemodel (= 3.2.
|
29
|
-
activesupport (= 3.2.
|
27
|
+
activerecord (3.2.9)
|
28
|
+
activemodel (= 3.2.9)
|
29
|
+
activesupport (= 3.2.9)
|
30
30
|
arel (~> 3.0.2)
|
31
31
|
tzinfo (~> 0.3.29)
|
32
|
-
activeresource (3.2.
|
33
|
-
activemodel (= 3.2.
|
34
|
-
activesupport (= 3.2.
|
35
|
-
activesupport (3.2.
|
32
|
+
activeresource (3.2.9)
|
33
|
+
activemodel (= 3.2.9)
|
34
|
+
activesupport (= 3.2.9)
|
35
|
+
activesupport (3.2.9)
|
36
36
|
i18n (~> 0.6)
|
37
37
|
multi_json (~> 1.0)
|
38
|
-
appraisal (0.
|
38
|
+
appraisal (0.5.1)
|
39
39
|
bundler
|
40
40
|
rake
|
41
41
|
arel (3.0.2)
|
42
|
-
aruba (0.
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
builder (3.0.0)
|
53
|
-
childprocess (0.3.1)
|
54
|
-
ffi (~> 1.0.6)
|
55
|
-
cucumber (1.1.9)
|
42
|
+
aruba (0.5.1)
|
43
|
+
childprocess (~> 0.3.6)
|
44
|
+
cucumber (>= 1.1.1)
|
45
|
+
rspec-expectations (>= 2.7.0)
|
46
|
+
bourne (1.2.1)
|
47
|
+
mocha (= 0.12.7)
|
48
|
+
builder (3.0.4)
|
49
|
+
childprocess (0.3.6)
|
50
|
+
ffi (~> 1.0, >= 1.0.6)
|
51
|
+
cucumber (1.2.1)
|
56
52
|
builder (>= 2.1.2)
|
57
|
-
diff-lcs (>= 1.1.
|
58
|
-
gherkin (~> 2.
|
53
|
+
diff-lcs (>= 1.1.3)
|
54
|
+
gherkin (~> 2.11.0)
|
59
55
|
json (>= 1.4.6)
|
60
|
-
term-ansicolor (>= 1.0.6)
|
61
56
|
diff-lcs (1.1.3)
|
62
57
|
erubis (2.7.0)
|
63
|
-
ffi (1.0
|
64
|
-
gherkin (2.
|
58
|
+
ffi (1.2.0)
|
59
|
+
gherkin (2.11.5)
|
65
60
|
json (>= 1.4.6)
|
66
61
|
hike (1.2.1)
|
67
|
-
i18n (0.6.
|
68
|
-
journey (1.0.
|
69
|
-
json (1.
|
62
|
+
i18n (0.6.1)
|
63
|
+
journey (1.0.4)
|
64
|
+
json (1.7.6)
|
70
65
|
mail (2.4.4)
|
71
66
|
i18n (>= 0.4.0)
|
72
67
|
mime-types (~> 1.16)
|
73
68
|
treetop (~> 1.4.8)
|
74
69
|
metaclass (0.0.1)
|
75
|
-
mime-types (1.
|
76
|
-
mocha (0.
|
70
|
+
mime-types (1.19)
|
71
|
+
mocha (0.12.7)
|
77
72
|
metaclass (~> 0.0.1)
|
78
|
-
multi_json (1.
|
73
|
+
multi_json (1.5.0)
|
79
74
|
polyglot (0.3.3)
|
80
|
-
rack (1.4.
|
75
|
+
rack (1.4.4)
|
81
76
|
rack-cache (1.2)
|
82
77
|
rack (>= 0.4)
|
83
78
|
rack-ssl (1.3.2)
|
84
79
|
rack
|
85
|
-
rack-test (0.6.
|
80
|
+
rack-test (0.6.2)
|
86
81
|
rack (>= 1.0)
|
87
|
-
rails (3.2.
|
88
|
-
actionmailer (= 3.2.
|
89
|
-
actionpack (= 3.2.
|
90
|
-
activerecord (= 3.2.
|
91
|
-
activeresource (= 3.2.
|
92
|
-
activesupport (= 3.2.
|
82
|
+
rails (3.2.9)
|
83
|
+
actionmailer (= 3.2.9)
|
84
|
+
actionpack (= 3.2.9)
|
85
|
+
activerecord (= 3.2.9)
|
86
|
+
activeresource (= 3.2.9)
|
87
|
+
activesupport (= 3.2.9)
|
93
88
|
bundler (~> 1.0)
|
94
|
-
railties (= 3.2.
|
95
|
-
railties (3.2.
|
96
|
-
actionpack (= 3.2.
|
97
|
-
activesupport (= 3.2.
|
89
|
+
railties (= 3.2.9)
|
90
|
+
railties (3.2.9)
|
91
|
+
actionpack (= 3.2.9)
|
92
|
+
activesupport (= 3.2.9)
|
98
93
|
rack-ssl (~> 1.3.2)
|
99
94
|
rake (>= 0.8.7)
|
100
95
|
rdoc (~> 3.4)
|
101
|
-
thor (
|
102
|
-
rake (0.
|
103
|
-
rdiscount (1.6.8)
|
96
|
+
thor (>= 0.14.6, < 2.0)
|
97
|
+
rake (10.0.3)
|
104
98
|
rdoc (3.12)
|
105
99
|
json (~> 1.4)
|
106
100
|
rspec (2.8.0)
|
@@ -116,19 +110,23 @@ GEM
|
|
116
110
|
activesupport (>= 3.0)
|
117
111
|
railties (>= 3.0)
|
118
112
|
rspec (~> 2.8.0)
|
119
|
-
shoulda-context (1.0.
|
120
|
-
sprockets (2.
|
113
|
+
shoulda-context (1.0.1)
|
114
|
+
sprockets (2.2.2)
|
121
115
|
hike (~> 1.2)
|
116
|
+
multi_json (~> 1.0)
|
122
117
|
rack (~> 1.0)
|
123
118
|
tilt (~> 1.1, != 1.3.0)
|
124
|
-
sqlite3 (1.3.
|
125
|
-
|
126
|
-
|
119
|
+
sqlite3 (1.3.6)
|
120
|
+
strong_parameters (0.1.5)
|
121
|
+
actionpack (~> 3.1)
|
122
|
+
activemodel (~> 3.1)
|
123
|
+
railties (~> 3.1)
|
124
|
+
thor (0.16.0)
|
127
125
|
tilt (1.3.3)
|
128
|
-
treetop (1.4.
|
126
|
+
treetop (1.4.12)
|
129
127
|
polyglot
|
130
128
|
polyglot (>= 0.3.1)
|
131
|
-
tzinfo (0.3.
|
129
|
+
tzinfo (0.3.35)
|
132
130
|
|
133
131
|
PLATFORMS
|
134
132
|
ruby
|
@@ -136,16 +134,17 @@ PLATFORMS
|
|
136
134
|
DEPENDENCIES
|
137
135
|
activerecord-jdbc-adapter
|
138
136
|
activerecord-jdbcsqlite3-adapter
|
139
|
-
appraisal (~> 0.4
|
137
|
+
appraisal (~> 0.4)
|
140
138
|
aruba
|
141
139
|
bundler (~> 1.1)
|
142
|
-
cucumber (~> 1.1
|
140
|
+
cucumber (~> 1.1)
|
143
141
|
jdbc-sqlite3
|
144
142
|
jruby-openssl
|
145
143
|
rails (~> 3.0)
|
146
|
-
rake (
|
144
|
+
rake (>= 0.9.2)
|
147
145
|
rspec-rails (~> 2.8.1)
|
148
146
|
shoulda-context (~> 1.0.0)
|
149
147
|
shoulda-matchers!
|
150
148
|
sqlite3
|
149
|
+
strong_parameters
|
151
150
|
therubyrhino
|
data/MIT-LICENSE
CHANGED
data/NEWS.md
CHANGED
@@ -1,10 +1,28 @@
|
|
1
|
+
# HEAD
|
2
|
+
|
3
|
+
# v 1.5.0
|
4
|
+
* Deprecate the following matchers:
|
5
|
+
* assign_to
|
6
|
+
* respond_with_content_type
|
7
|
+
* query_the_database
|
8
|
+
* validate_format_of
|
9
|
+
* have_sent_email
|
10
|
+
* strong_parameters_matcher
|
11
|
+
* delegate_method
|
12
|
+
|
13
|
+
* Use RSpec's native `configure.include` syntax for including matchers into
|
14
|
+
RSpec (#204)
|
15
|
+
|
16
|
+
* Do not force minitest loading when test-unit is available (this was fixed
|
17
|
+
before 1.3.0 then reverted in 1.3.0) (#181)
|
18
|
+
|
1
19
|
# v1.4.2
|
2
|
-
* Added a new delegate_method matcher.
|
20
|
+
* Added a new `delegate_method` matcher.
|
3
21
|
|
4
22
|
# v1.4.1
|
5
23
|
* Fixes an issue when used with Test::Unit on the allow value matcher.
|
6
24
|
|
7
|
-
* Fixes an issue with using ensure_inclusion_of(:attr) given an array of true or false values.
|
25
|
+
* Fixes an issue with using `ensure_inclusion_of(:attr)` given an array of true or false values.
|
8
26
|
|
9
27
|
# v1.4.0
|
10
28
|
|
@@ -16,7 +34,7 @@
|
|
16
34
|
|
17
35
|
* You can now pass an array to `ensure_exclusion_of` using `in_array`.
|
18
36
|
|
19
|
-
* Allow testing of
|
37
|
+
* Allow testing of `:foreign_key` option for `has_one` relationships using the association matcher.
|
20
38
|
|
21
39
|
* Fix bug where `ensure_length_of` would pass if the given string was too long.
|
22
40
|
|
@@ -24,7 +42,7 @@
|
|
24
42
|
|
25
43
|
* Test outside values for `ensure_inclusion_of` when given an array.
|
26
44
|
|
27
|
-
* Fixed the output of the set_the_flash matcher.
|
45
|
+
* Fixed the output of the `set_the_flash` matcher.
|
28
46
|
|
29
47
|
# v1.3.0
|
30
48
|
|
data/README.md
CHANGED
@@ -51,6 +51,8 @@ Matchers to test common patterns:
|
|
51
51
|
|
52
52
|
```ruby
|
53
53
|
describe PostsController, "#show" do
|
54
|
+
it { should permit(:title, :body).for(:create) }
|
55
|
+
|
54
56
|
context "for a fictional user" do
|
55
57
|
before do
|
56
58
|
get :show, :id => 1
|
@@ -99,5 +101,5 @@ Thank you to all the [contributors](https://github.com/thoughtbot/shoulda-matche
|
|
99
101
|
|
100
102
|
## License
|
101
103
|
|
102
|
-
Shoulda is Copyright © 2006-
|
104
|
+
Shoulda is Copyright © 2006-2013 thoughtbot, inc.
|
103
105
|
It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.
|
data/Rakefile
CHANGED
@@ -15,10 +15,14 @@ Cucumber::Rake::Task.new do |t|
|
|
15
15
|
t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'progress')]
|
16
16
|
end
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
task :default do |t|
|
19
|
+
if ENV['BUNDLE_GEMFILE'] =~ /gemfiles/
|
20
|
+
exec 'rake spec cucumber'
|
21
|
+
else
|
22
|
+
Rake::Task['appraise'].execute
|
23
|
+
end
|
21
24
|
end
|
22
25
|
|
23
|
-
|
24
|
-
|
26
|
+
task :appraise => ['appraisal:install'] do |t|
|
27
|
+
exec 'rake appraisal'
|
28
|
+
end
|
@@ -25,8 +25,8 @@ When 'I generate a new rails application' do
|
|
25
25
|
And I set the "BUNDLE_GEMFILE" environment variable to "Gemfile"
|
26
26
|
And I successfully run `bundle install --local`
|
27
27
|
}
|
28
|
-
if RUBY_VERSION >=
|
29
|
-
append_to_gemfile %(gem
|
28
|
+
if RUBY_VERSION >= '1.9.3'
|
29
|
+
append_to_gemfile %(gem 'rake', '~> 0.9.3.beta.1')
|
30
30
|
step %(I successfully run `bundle update rake`)
|
31
31
|
end
|
32
32
|
end
|
@@ -52,7 +52,7 @@ When 'I run the rspec generator' do
|
|
52
52
|
end
|
53
53
|
|
54
54
|
When 'I configure the application to use rspec-rails' do
|
55
|
-
append_to_gemfile
|
55
|
+
append_to_gemfile %q(gem 'rspec-rails', '~> 2.8.1')
|
56
56
|
steps %{And I run `bundle install --local`}
|
57
57
|
end
|
58
58
|
|
@@ -66,7 +66,7 @@ When 'I configure the application to use rspec-rails in test and development' do
|
|
66
66
|
end
|
67
67
|
|
68
68
|
When 'I configure the application to use shoulda-context' do
|
69
|
-
append_to_gemfile
|
69
|
+
append_to_gemfile %q(gem 'shoulda-context', '~> 1.0.0')
|
70
70
|
steps %{And I run `bundle install --local`}
|
71
71
|
end
|
72
72
|
|
@@ -106,7 +106,7 @@ end
|
|
106
106
|
module FileHelpers
|
107
107
|
def append_to(path, contents)
|
108
108
|
in_current_dir do
|
109
|
-
File.open(path,
|
109
|
+
File.open(path, 'a') do |file|
|
110
110
|
file.puts
|
111
111
|
file.puts contents
|
112
112
|
end
|
@@ -119,9 +119,9 @@ module FileHelpers
|
|
119
119
|
|
120
120
|
def comment_out_gem_in_gemfile(gemname)
|
121
121
|
in_current_dir do
|
122
|
-
gemfile = File.read(
|
122
|
+
gemfile = File.read('Gemfile')
|
123
123
|
gemfile.sub!(/^(\s*)(gem\s*['"]#{gemname})/, "\\1# \\2")
|
124
|
-
File.open(
|
124
|
+
File.open('Gemfile', 'w'){ |file| file.write(gemfile) }
|
125
125
|
end
|
126
126
|
end
|
127
127
|
end
|
data/features/support/env.rb
CHANGED
data/gemfiles/3.0.gemfile
CHANGED
data/gemfiles/3.0.gemfile.lock
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: /Users/draper/Dropbox/Development/shoulda-matchers
|
3
3
|
specs:
|
4
|
-
shoulda-matchers (1.
|
4
|
+
shoulda-matchers (1.5.0)
|
5
5
|
activesupport (>= 3.0.0)
|
6
|
-
bourne (~> 1.
|
6
|
+
bourne (~> 1.2.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: http://rubygems.org/
|
@@ -35,7 +35,7 @@ GEM
|
|
35
35
|
activemodel (= 3.0.17)
|
36
36
|
activesupport (= 3.0.17)
|
37
37
|
activesupport (3.0.17)
|
38
|
-
appraisal (0.
|
38
|
+
appraisal (0.5.1)
|
39
39
|
bundler
|
40
40
|
rake
|
41
41
|
arel (2.0.10)
|
@@ -43,25 +43,24 @@ GEM
|
|
43
43
|
childprocess (~> 0.3.6)
|
44
44
|
cucumber (>= 1.1.1)
|
45
45
|
rspec-expectations (>= 2.7.0)
|
46
|
-
bourne (1.1
|
47
|
-
mocha (= 0.
|
46
|
+
bourne (1.2.1)
|
47
|
+
mocha (= 0.12.7)
|
48
48
|
builder (2.1.2)
|
49
49
|
childprocess (0.3.6)
|
50
50
|
ffi (~> 1.0, >= 1.0.6)
|
51
|
-
cucumber (1.1
|
51
|
+
cucumber (1.2.1)
|
52
52
|
builder (>= 2.1.2)
|
53
|
-
diff-lcs (>= 1.1.
|
54
|
-
gherkin (~> 2.
|
53
|
+
diff-lcs (>= 1.1.3)
|
54
|
+
gherkin (~> 2.11.0)
|
55
55
|
json (>= 1.4.6)
|
56
|
-
term-ansicolor (>= 1.0.6)
|
57
56
|
diff-lcs (1.1.3)
|
58
57
|
erubis (2.6.6)
|
59
58
|
abstract (>= 1.0.0)
|
60
|
-
ffi (1.
|
61
|
-
gherkin (2.
|
59
|
+
ffi (1.3.1)
|
60
|
+
gherkin (2.11.5)
|
62
61
|
json (>= 1.4.6)
|
63
62
|
i18n (0.5.0)
|
64
|
-
json (1.7.
|
63
|
+
json (1.7.6)
|
65
64
|
mail (2.2.19)
|
66
65
|
activesupport (>= 2.3.6)
|
67
66
|
i18n (>= 0.4.0)
|
@@ -69,10 +68,10 @@ GEM
|
|
69
68
|
treetop (~> 1.4.8)
|
70
69
|
metaclass (0.0.1)
|
71
70
|
mime-types (1.19)
|
72
|
-
mocha (0.
|
71
|
+
mocha (0.12.7)
|
73
72
|
metaclass (~> 0.0.1)
|
74
73
|
polyglot (0.3.3)
|
75
|
-
rack (1.2.
|
74
|
+
rack (1.2.7)
|
76
75
|
rack-mount (0.6.14)
|
77
76
|
rack (>= 1.0.0)
|
78
77
|
rack-test (0.5.7)
|
@@ -91,7 +90,7 @@ GEM
|
|
91
90
|
rake (>= 0.8.7)
|
92
91
|
rdoc (~> 3.4)
|
93
92
|
thor (~> 0.14.4)
|
94
|
-
rake (0.
|
93
|
+
rake (10.0.3)
|
95
94
|
rdoc (3.12)
|
96
95
|
json (~> 1.4)
|
97
96
|
rspec (2.8.0)
|
@@ -107,9 +106,12 @@ GEM
|
|
107
106
|
activesupport (>= 3.0)
|
108
107
|
railties (>= 3.0)
|
109
108
|
rspec (~> 2.8.0)
|
110
|
-
shoulda-context (1.0.
|
111
|
-
sqlite3 (1.3.
|
112
|
-
|
109
|
+
shoulda-context (1.0.2)
|
110
|
+
sqlite3 (1.3.7)
|
111
|
+
strong_parameters (0.1.6)
|
112
|
+
actionpack (~> 3.0)
|
113
|
+
activemodel (~> 3.0)
|
114
|
+
railties (~> 3.0)
|
113
115
|
thor (0.14.6)
|
114
116
|
treetop (1.4.12)
|
115
117
|
polyglot
|
@@ -122,16 +124,17 @@ PLATFORMS
|
|
122
124
|
DEPENDENCIES
|
123
125
|
activerecord-jdbc-adapter
|
124
126
|
activerecord-jdbcsqlite3-adapter
|
125
|
-
appraisal (~> 0.4
|
127
|
+
appraisal (~> 0.4)
|
126
128
|
aruba
|
127
129
|
bundler (~> 1.1)
|
128
|
-
cucumber (~> 1.1
|
130
|
+
cucumber (~> 1.1)
|
129
131
|
jdbc-sqlite3
|
130
132
|
jruby-openssl
|
131
|
-
rails (
|
132
|
-
rake (
|
133
|
+
rails (~> 3.0.17)
|
134
|
+
rake (>= 0.9.2)
|
133
135
|
rspec-rails (~> 2.8.1)
|
134
136
|
shoulda-context (~> 1.0.0)
|
135
137
|
shoulda-matchers!
|
136
138
|
sqlite3
|
139
|
+
strong_parameters
|
137
140
|
therubyrhino
|