shoulda-matchers 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. data/.travis.yml +1 -0
  2. data/Appraisals +3 -3
  3. data/Gemfile.lock +2 -2
  4. data/NEWS.md +20 -0
  5. data/README.md +1 -1
  6. data/gemfiles/3.0.gemfile +1 -1
  7. data/gemfiles/3.0.gemfile.lock +27 -27
  8. data/gemfiles/3.1.gemfile +1 -1
  9. data/gemfiles/3.1.gemfile.lock +36 -36
  10. data/gemfiles/3.2.gemfile +1 -1
  11. data/gemfiles/3.2.gemfile.lock +35 -35
  12. data/lib/shoulda/matchers/action_controller/set_the_flash_matcher.rb +4 -1
  13. data/lib/shoulda/matchers/active_model.rb +14 -0
  14. data/lib/shoulda/matchers/active_model/allow_value_matcher.rb +45 -21
  15. data/lib/shoulda/matchers/active_model/ensure_exclusion_of_matcher.rb +28 -6
  16. data/lib/shoulda/matchers/active_model/ensure_inclusion_of_matcher.rb +22 -4
  17. data/lib/shoulda/matchers/active_model/ensure_length_of_matcher.rb +1 -0
  18. data/lib/shoulda/matchers/active_model/errors.rb +7 -0
  19. data/lib/shoulda/matchers/active_model/exception_message_finder.rb +58 -0
  20. data/lib/shoulda/matchers/active_model/validate_uniqueness_of_matcher.rb +9 -1
  21. data/lib/shoulda/matchers/active_model/validation_matcher.rb +27 -8
  22. data/lib/shoulda/matchers/active_model/validation_message_finder.rb +69 -0
  23. data/lib/shoulda/matchers/active_record/association_matcher.rb +14 -5
  24. data/lib/shoulda/matchers/active_record/have_db_index_matcher.rb +8 -5
  25. data/lib/shoulda/matchers/version.rb +1 -1
  26. data/shoulda-matchers.gemspec +1 -1
  27. data/spec/shoulda/action_controller/set_the_flash_matcher_spec.rb +6 -0
  28. data/spec/shoulda/active_model/allow_value_matcher_spec.rb +32 -0
  29. data/spec/shoulda/active_model/ensure_exclusion_of_matcher_spec.rb +23 -1
  30. data/spec/shoulda/active_model/ensure_inclusion_of_matcher_spec.rb +49 -0
  31. data/spec/shoulda/active_model/ensure_length_of_matcher_spec.rb +13 -0
  32. data/spec/shoulda/active_model/exception_message_finder_spec.rb +112 -0
  33. data/spec/shoulda/active_model/validate_presence_of_matcher_spec.rb +15 -0
  34. data/spec/shoulda/active_model/validation_message_finder_spec.rb +107 -0
  35. data/spec/shoulda/active_record/association_matcher_spec.rb +8 -0
  36. data/spec/shoulda/active_record/have_db_index_matcher_spec.rb +17 -0
  37. metadata +18 -6
@@ -11,6 +11,7 @@ script: "bundle exec rake spec cucumber"
11
11
  gemfile:
12
12
  - gemfiles/3.0.gemfile
13
13
  - gemfiles/3.1.gemfile
14
+ - gemfiles/3.2.gemfile
14
15
 
15
16
  matrix:
16
17
  allow_failures:
data/Appraisals CHANGED
@@ -1,15 +1,15 @@
1
1
  appraise '3.0' do
2
- gem 'rails', '3.0.12'
2
+ gem 'rails', '3.0.17'
3
3
  end
4
4
 
5
5
  appraise '3.1' do
6
- gem 'rails', '3.1.4'
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.3'
12
+ gem 'rails', '3.2.8'
13
13
  gem 'jquery-rails'
14
14
  gem 'sass-rails'
15
15
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shoulda-matchers (1.3.0)
4
+ shoulda-matchers (1.4.0)
5
5
  activesupport (>= 3.0.0)
6
6
 
7
7
  GEM
@@ -138,7 +138,7 @@ DEPENDENCIES
138
138
  appraisal (~> 0.4.0)
139
139
  aruba
140
140
  bourne (~> 1.1.2)
141
- bundler (~> 1.1.0)
141
+ bundler (~> 1.1)
142
142
  cucumber (~> 1.1.9)
143
143
  jdbc-sqlite3
144
144
  jruby-openssl
data/NEWS.md CHANGED
@@ -1,3 +1,23 @@
1
+ # v1.4.0
2
+
3
+ * Added `strict` option to validation matchers.
4
+
5
+ * Verify that arguments to `set_the_flash` matcher are valid.
6
+
7
+ * Fix issue in ValidateUniquenessMatcher that could cause an error on postgres.
8
+
9
+ * You can now pass an array to `ensure_exclusion_of` using `in_array`.
10
+
11
+ * Allow testing of :foreign_key option for has_one relationships using the association matcher.
12
+
13
+ * Fix bug where `ensure_length_of` would pass if the given string was too long.
14
+
15
+ * `allow_blank` will now allow values such as: ' ', '\n', and '\r'.
16
+
17
+ * Test outside values for `ensure_inclusion_of` when given an array.
18
+
19
+ * Fixed the output of the set_the_flash matcher.
20
+
1
21
  # v1.3.0
2
22
 
3
23
  * `validate_format_of` will accept `allow_blank(bool)` and `allow_nil(bool)`
data/README.md CHANGED
@@ -80,5 +80,5 @@ Thank you to all the [contributors](https://github.com/thoughtbot/shoulda-matche
80
80
 
81
81
  ## License
82
82
 
83
- Shoulda is Copyright © 2006-2010 thoughtbot, inc.
83
+ Shoulda is Copyright © 2006-2012 thoughtbot, inc.
84
84
  It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.
@@ -9,6 +9,6 @@ gem "activerecord-jdbcsqlite3-adapter", :platform=>:jruby
9
9
  gem "jdbc-sqlite3", :platform=>:jruby
10
10
  gem "jruby-openssl", :platform=>:jruby
11
11
  gem "therubyrhino", :platform=>:jruby
12
- gem "rails", "3.0.12"
12
+ gem "rails", "3.0.17"
13
13
 
14
14
  gemspec :path=>"../"
@@ -1,5 +1,5 @@
1
1
  PATH
2
- remote: /Users/joshuaclayton/dev/gems/shoulda-matchers
2
+ remote: /Users/draper/Dropbox/Development/shoulda-matchers
3
3
  specs:
4
4
  shoulda-matchers (1.3.0)
5
5
  activesupport (>= 3.0.0)
@@ -8,12 +8,12 @@ GEM
8
8
  remote: http://rubygems.org/
9
9
  specs:
10
10
  abstract (1.0.0)
11
- actionmailer (3.0.12)
12
- actionpack (= 3.0.12)
11
+ actionmailer (3.0.17)
12
+ actionpack (= 3.0.17)
13
13
  mail (~> 2.2.19)
14
- actionpack (3.0.12)
15
- activemodel (= 3.0.12)
16
- activesupport (= 3.0.12)
14
+ actionpack (3.0.17)
15
+ activemodel (= 3.0.17)
16
+ activesupport (= 3.0.17)
17
17
  builder (~> 2.1.2)
18
18
  erubis (~> 2.6.6)
19
19
  i18n (~> 0.5.0)
@@ -21,19 +21,19 @@ GEM
21
21
  rack-mount (~> 0.6.14)
22
22
  rack-test (~> 0.5.7)
23
23
  tzinfo (~> 0.3.23)
24
- activemodel (3.0.12)
25
- activesupport (= 3.0.12)
24
+ activemodel (3.0.17)
25
+ activesupport (= 3.0.17)
26
26
  builder (~> 2.1.2)
27
27
  i18n (~> 0.5.0)
28
- activerecord (3.0.12)
29
- activemodel (= 3.0.12)
30
- activesupport (= 3.0.12)
28
+ activerecord (3.0.17)
29
+ activemodel (= 3.0.17)
30
+ activesupport (= 3.0.17)
31
31
  arel (~> 2.0.10)
32
32
  tzinfo (~> 0.3.23)
33
- activeresource (3.0.12)
34
- activemodel (= 3.0.12)
35
- activesupport (= 3.0.12)
36
- activesupport (3.0.12)
33
+ activeresource (3.0.17)
34
+ activemodel (= 3.0.17)
35
+ activesupport (= 3.0.17)
36
+ activesupport (3.0.17)
37
37
  appraisal (0.4.1)
38
38
  bundler
39
39
  rake
@@ -77,17 +77,17 @@ GEM
77
77
  rack (>= 1.0.0)
78
78
  rack-test (0.5.7)
79
79
  rack (>= 1.0)
80
- rails (3.0.12)
81
- actionmailer (= 3.0.12)
82
- actionpack (= 3.0.12)
83
- activerecord (= 3.0.12)
84
- activeresource (= 3.0.12)
85
- activesupport (= 3.0.12)
80
+ rails (3.0.17)
81
+ actionmailer (= 3.0.17)
82
+ actionpack (= 3.0.17)
83
+ activerecord (= 3.0.17)
84
+ activeresource (= 3.0.17)
85
+ activesupport (= 3.0.17)
86
86
  bundler (~> 1.0)
87
- railties (= 3.0.12)
88
- railties (3.0.12)
89
- actionpack (= 3.0.12)
90
- activesupport (= 3.0.12)
87
+ railties (= 3.0.17)
88
+ railties (3.0.17)
89
+ actionpack (= 3.0.17)
90
+ activesupport (= 3.0.17)
91
91
  rake (>= 0.8.7)
92
92
  rdoc (~> 3.4)
93
93
  thor (~> 0.14.4)
@@ -125,11 +125,11 @@ DEPENDENCIES
125
125
  appraisal (~> 0.4.0)
126
126
  aruba
127
127
  bourne (~> 1.1.2)
128
- bundler (~> 1.1.0)
128
+ bundler (~> 1.1)
129
129
  cucumber (~> 1.1.9)
130
130
  jdbc-sqlite3
131
131
  jruby-openssl
132
- rails (= 3.0.12)
132
+ rails (= 3.0.17)
133
133
  rake (~> 0.9.2)
134
134
  rspec-rails (~> 2.8.1)
135
135
  shoulda-context (~> 1.0.0)
@@ -9,7 +9,7 @@ gem "activerecord-jdbcsqlite3-adapter", :platform=>:jruby
9
9
  gem "jdbc-sqlite3", :platform=>:jruby
10
10
  gem "jruby-openssl", :platform=>:jruby
11
11
  gem "therubyrhino", :platform=>:jruby
12
- gem "rails", "3.1.4"
12
+ gem "rails", "3.1.8"
13
13
  gem "jquery-rails"
14
14
  gem "sass-rails"
15
15
 
@@ -1,5 +1,5 @@
1
1
  PATH
2
- remote: /Users/joshuaclayton/dev/gems/shoulda-matchers
2
+ remote: /Users/draper/Dropbox/Development/shoulda-matchers
3
3
  specs:
4
4
  shoulda-matchers (1.3.0)
5
5
  activesupport (>= 3.0.0)
@@ -7,34 +7,34 @@ PATH
7
7
  GEM
8
8
  remote: http://rubygems.org/
9
9
  specs:
10
- actionmailer (3.1.4)
11
- actionpack (= 3.1.4)
12
- mail (~> 2.3.0)
13
- actionpack (3.1.4)
14
- activemodel (= 3.1.4)
15
- activesupport (= 3.1.4)
10
+ actionmailer (3.1.8)
11
+ actionpack (= 3.1.8)
12
+ mail (~> 2.3.3)
13
+ actionpack (3.1.8)
14
+ activemodel (= 3.1.8)
15
+ activesupport (= 3.1.8)
16
16
  builder (~> 3.0.0)
17
17
  erubis (~> 2.7.0)
18
18
  i18n (~> 0.6)
19
19
  rack (~> 1.3.6)
20
- rack-cache (~> 1.1)
20
+ rack-cache (~> 1.2)
21
21
  rack-mount (~> 0.8.2)
22
22
  rack-test (~> 0.6.1)
23
- sprockets (~> 2.0.3)
24
- activemodel (3.1.4)
25
- activesupport (= 3.1.4)
23
+ sprockets (~> 2.0.4)
24
+ activemodel (3.1.8)
25
+ activesupport (= 3.1.8)
26
26
  builder (~> 3.0.0)
27
27
  i18n (~> 0.6)
28
- activerecord (3.1.4)
29
- activemodel (= 3.1.4)
30
- activesupport (= 3.1.4)
28
+ activerecord (3.1.8)
29
+ activemodel (= 3.1.8)
30
+ activesupport (= 3.1.8)
31
31
  arel (~> 2.2.3)
32
32
  tzinfo (~> 0.3.29)
33
- activeresource (3.1.4)
34
- activemodel (= 3.1.4)
35
- activesupport (= 3.1.4)
36
- activesupport (3.1.4)
37
- multi_json (~> 1.0)
33
+ activeresource (3.1.8)
34
+ activemodel (= 3.1.8)
35
+ activesupport (= 3.1.8)
36
+ activesupport (3.1.8)
37
+ multi_json (>= 1.0, < 1.3)
38
38
  appraisal (0.4.1)
39
39
  bundler
40
40
  rake
@@ -46,7 +46,7 @@ GEM
46
46
  rspec (>= 2.7.0)
47
47
  bourne (1.1.2)
48
48
  mocha (= 0.10.5)
49
- builder (3.0.0)
49
+ builder (3.0.3)
50
50
  childprocess (0.3.5)
51
51
  ffi (~> 1.0, >= 1.0.6)
52
52
  cucumber (1.1.9)
@@ -61,8 +61,8 @@ GEM
61
61
  gherkin (2.9.3)
62
62
  json (>= 1.4.6)
63
63
  hike (1.2.1)
64
- i18n (0.6.0)
65
- jquery-rails (2.1.1)
64
+ i18n (0.6.1)
65
+ jquery-rails (2.1.3)
66
66
  railties (>= 3.1.0, < 5.0)
67
67
  thor (~> 0.14)
68
68
  json (1.7.5)
@@ -74,7 +74,7 @@ GEM
74
74
  mime-types (1.19)
75
75
  mocha (0.10.5)
76
76
  metaclass (~> 0.0.1)
77
- multi_json (1.3.6)
77
+ multi_json (1.2.0)
78
78
  polyglot (0.3.3)
79
79
  rack (1.3.6)
80
80
  rack-cache (1.2)
@@ -83,19 +83,19 @@ GEM
83
83
  rack (>= 1.0.0)
84
84
  rack-ssl (1.3.2)
85
85
  rack
86
- rack-test (0.6.1)
86
+ rack-test (0.6.2)
87
87
  rack (>= 1.0)
88
- rails (3.1.4)
89
- actionmailer (= 3.1.4)
90
- actionpack (= 3.1.4)
91
- activerecord (= 3.1.4)
92
- activeresource (= 3.1.4)
93
- activesupport (= 3.1.4)
88
+ rails (3.1.8)
89
+ actionmailer (= 3.1.8)
90
+ actionpack (= 3.1.8)
91
+ activerecord (= 3.1.8)
92
+ activeresource (= 3.1.8)
93
+ activesupport (= 3.1.8)
94
94
  bundler (~> 1.0)
95
- railties (= 3.1.4)
96
- railties (3.1.4)
97
- actionpack (= 3.1.4)
98
- activesupport (= 3.1.4)
95
+ railties (= 3.1.8)
96
+ railties (3.1.8)
97
+ actionpack (= 3.1.8)
98
+ activesupport (= 3.1.8)
99
99
  rack-ssl (~> 1.3.2)
100
100
  rake (>= 0.8.7)
101
101
  rdoc (~> 3.4)
@@ -145,12 +145,12 @@ DEPENDENCIES
145
145
  appraisal (~> 0.4.0)
146
146
  aruba
147
147
  bourne (~> 1.1.2)
148
- bundler (~> 1.1.0)
148
+ bundler (~> 1.1)
149
149
  cucumber (~> 1.1.9)
150
150
  jdbc-sqlite3
151
151
  jquery-rails
152
152
  jruby-openssl
153
- rails (= 3.1.4)
153
+ rails (= 3.1.8)
154
154
  rake (~> 0.9.2)
155
155
  rspec-rails (~> 2.8.1)
156
156
  sass-rails
@@ -9,7 +9,7 @@ gem "activerecord-jdbcsqlite3-adapter", :platform=>:jruby
9
9
  gem "jdbc-sqlite3", :platform=>:jruby
10
10
  gem "jruby-openssl", :platform=>:jruby
11
11
  gem "therubyrhino", :platform=>:jruby
12
- gem "rails", "3.2.3"
12
+ gem "rails", "3.2.8"
13
13
  gem "jquery-rails"
14
14
  gem "sass-rails"
15
15
 
@@ -1,5 +1,5 @@
1
1
  PATH
2
- remote: /Users/joshuaclayton/dev/gems/shoulda-matchers
2
+ remote: /Users/draper/Dropbox/Development/shoulda-matchers
3
3
  specs:
4
4
  shoulda-matchers (1.3.0)
5
5
  activesupport (>= 3.0.0)
@@ -7,31 +7,31 @@ PATH
7
7
  GEM
8
8
  remote: http://rubygems.org/
9
9
  specs:
10
- actionmailer (3.2.3)
11
- actionpack (= 3.2.3)
10
+ actionmailer (3.2.8)
11
+ actionpack (= 3.2.8)
12
12
  mail (~> 2.4.4)
13
- actionpack (3.2.3)
14
- activemodel (= 3.2.3)
15
- activesupport (= 3.2.3)
13
+ actionpack (3.2.8)
14
+ activemodel (= 3.2.8)
15
+ activesupport (= 3.2.8)
16
16
  builder (~> 3.0.0)
17
17
  erubis (~> 2.7.0)
18
- journey (~> 1.0.1)
18
+ journey (~> 1.0.4)
19
19
  rack (~> 1.4.0)
20
20
  rack-cache (~> 1.2)
21
21
  rack-test (~> 0.6.1)
22
- sprockets (~> 2.1.2)
23
- activemodel (3.2.3)
24
- activesupport (= 3.2.3)
22
+ sprockets (~> 2.1.3)
23
+ activemodel (3.2.8)
24
+ activesupport (= 3.2.8)
25
25
  builder (~> 3.0.0)
26
- activerecord (3.2.3)
27
- activemodel (= 3.2.3)
28
- activesupport (= 3.2.3)
26
+ activerecord (3.2.8)
27
+ activemodel (= 3.2.8)
28
+ activesupport (= 3.2.8)
29
29
  arel (~> 3.0.2)
30
30
  tzinfo (~> 0.3.29)
31
- activeresource (3.2.3)
32
- activemodel (= 3.2.3)
33
- activesupport (= 3.2.3)
34
- activesupport (3.2.3)
31
+ activeresource (3.2.8)
32
+ activemodel (= 3.2.8)
33
+ activesupport (= 3.2.8)
34
+ activesupport (3.2.8)
35
35
  i18n (~> 0.6)
36
36
  multi_json (~> 1.0)
37
37
  appraisal (0.4.1)
@@ -45,7 +45,7 @@ GEM
45
45
  rspec (>= 2.7.0)
46
46
  bourne (1.1.2)
47
47
  mocha (= 0.10.5)
48
- builder (3.0.0)
48
+ builder (3.0.3)
49
49
  childprocess (0.3.5)
50
50
  ffi (~> 1.0, >= 1.0.6)
51
51
  cucumber (1.1.9)
@@ -60,9 +60,9 @@ GEM
60
60
  gherkin (2.9.3)
61
61
  json (>= 1.4.6)
62
62
  hike (1.2.1)
63
- i18n (0.6.0)
63
+ i18n (0.6.1)
64
64
  journey (1.0.4)
65
- jquery-rails (2.1.1)
65
+ jquery-rails (2.1.3)
66
66
  railties (>= 3.1.0, < 5.0)
67
67
  thor (~> 0.14)
68
68
  json (1.7.5)
@@ -81,23 +81,23 @@ GEM
81
81
  rack (>= 0.4)
82
82
  rack-ssl (1.3.2)
83
83
  rack
84
- rack-test (0.6.1)
84
+ rack-test (0.6.2)
85
85
  rack (>= 1.0)
86
- rails (3.2.3)
87
- actionmailer (= 3.2.3)
88
- actionpack (= 3.2.3)
89
- activerecord (= 3.2.3)
90
- activeresource (= 3.2.3)
91
- activesupport (= 3.2.3)
86
+ rails (3.2.8)
87
+ actionmailer (= 3.2.8)
88
+ actionpack (= 3.2.8)
89
+ activerecord (= 3.2.8)
90
+ activeresource (= 3.2.8)
91
+ activesupport (= 3.2.8)
92
92
  bundler (~> 1.0)
93
- railties (= 3.2.3)
94
- railties (3.2.3)
95
- actionpack (= 3.2.3)
96
- activesupport (= 3.2.3)
93
+ railties (= 3.2.8)
94
+ railties (3.2.8)
95
+ actionpack (= 3.2.8)
96
+ activesupport (= 3.2.8)
97
97
  rack-ssl (~> 1.3.2)
98
98
  rake (>= 0.8.7)
99
99
  rdoc (~> 3.4)
100
- thor (~> 0.14.6)
100
+ thor (>= 0.14.6, < 2.0)
101
101
  rake (0.9.2.2)
102
102
  rdoc (3.12)
103
103
  json (~> 1.4)
@@ -126,7 +126,7 @@ GEM
126
126
  tilt (~> 1.1, != 1.3.0)
127
127
  sqlite3 (1.3.6)
128
128
  term-ansicolor (1.0.7)
129
- thor (0.14.6)
129
+ thor (0.16.0)
130
130
  tilt (1.3.3)
131
131
  treetop (1.4.10)
132
132
  polyglot
@@ -142,12 +142,12 @@ DEPENDENCIES
142
142
  appraisal (~> 0.4.0)
143
143
  aruba
144
144
  bourne (~> 1.1.2)
145
- bundler (~> 1.1.0)
145
+ bundler (~> 1.1)
146
146
  cucumber (~> 1.1.9)
147
147
  jdbc-sqlite3
148
148
  jquery-rails
149
149
  jruby-openssl
150
- rails (= 3.2.3)
150
+ rails (= 3.2.8)
151
151
  rake (~> 0.9.2)
152
152
  rspec-rails (~> 2.8.1)
153
153
  sass-rails