shoulda-matchers 2.4.0 → 2.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +7 -4
  3. data/Appraisals +19 -7
  4. data/Gemfile.lock +1 -1
  5. data/NEWS.md +35 -0
  6. data/README.md +1204 -46
  7. data/features/step_definitions/rails_steps.rb +1 -1
  8. data/gemfiles/3.0.gemfile.lock +1 -1
  9. data/gemfiles/3.1.gemfile.lock +1 -1
  10. data/gemfiles/3.2.gemfile.lock +1 -1
  11. data/gemfiles/{4.0.gemfile → 4.0.0.gemfile} +4 -4
  12. data/gemfiles/{4.0.gemfile.lock → 4.0.0.gemfile.lock} +24 -24
  13. data/gemfiles/4.0.1.gemfile +19 -0
  14. data/gemfiles/4.0.1.gemfile.lock +161 -0
  15. data/lib/shoulda/matchers/action_controller.rb +1 -0
  16. data/lib/shoulda/matchers/action_controller/filter_param_matcher.rb +4 -2
  17. data/lib/shoulda/matchers/action_controller/redirect_to_matcher.rb +6 -3
  18. data/lib/shoulda/matchers/action_controller/render_template_matcher.rb +6 -3
  19. data/lib/shoulda/matchers/action_controller/render_with_layout_matcher.rb +4 -2
  20. data/lib/shoulda/matchers/action_controller/rescue_from_matcher.rb +4 -2
  21. data/lib/shoulda/matchers/action_controller/respond_with_matcher.rb +4 -2
  22. data/lib/shoulda/matchers/action_controller/route_matcher.rb +13 -19
  23. data/lib/shoulda/matchers/action_controller/route_params.rb +47 -0
  24. data/lib/shoulda/matchers/action_controller/set_session_matcher.rb +4 -2
  25. data/lib/shoulda/matchers/action_controller/set_the_flash_matcher.rb +4 -2
  26. data/lib/shoulda/matchers/active_model.rb +4 -3
  27. data/lib/shoulda/matchers/active_model/allow_mass_assignment_of_matcher.rb +9 -6
  28. data/lib/shoulda/matchers/active_model/allow_value_matcher.rb +4 -2
  29. data/lib/shoulda/matchers/active_model/disallow_value_matcher.rb +6 -4
  30. data/lib/shoulda/matchers/active_model/ensure_inclusion_of_matcher.rb +4 -1
  31. data/lib/shoulda/matchers/active_model/ensure_length_of_matcher.rb +8 -1
  32. data/lib/shoulda/matchers/active_model/have_secure_password_matcher.rb +4 -2
  33. data/lib/shoulda/matchers/active_model/numericality_matchers/comparison_matcher.rb +59 -0
  34. data/lib/shoulda/matchers/active_model/numericality_matchers/odd_even_number_matcher.rb +51 -0
  35. data/lib/shoulda/matchers/active_model/numericality_matchers/only_integer_matcher.rb +41 -0
  36. data/lib/shoulda/matchers/active_model/validate_absence_of_matcher.rb +77 -0
  37. data/lib/shoulda/matchers/active_model/validate_numericality_of_matcher.rb +14 -12
  38. data/lib/shoulda/matchers/active_model/validate_uniqueness_of_matcher.rb +6 -6
  39. data/lib/shoulda/matchers/active_model/validation_matcher.rb +10 -7
  40. data/lib/shoulda/matchers/active_record.rb +2 -0
  41. data/lib/shoulda/matchers/active_record/accept_nested_attributes_for_matcher.rb +4 -2
  42. data/lib/shoulda/matchers/active_record/association_matcher.rb +11 -3
  43. data/lib/shoulda/matchers/active_record/association_matchers/model_reflection.rb +80 -0
  44. data/lib/shoulda/matchers/active_record/association_matchers/model_reflector.rb +20 -55
  45. data/lib/shoulda/matchers/active_record/association_matchers/source_matcher.rb +40 -0
  46. data/lib/shoulda/matchers/active_record/have_db_column_matcher.rb +4 -2
  47. data/lib/shoulda/matchers/active_record/have_db_index_matcher.rb +4 -2
  48. data/lib/shoulda/matchers/active_record/have_readonly_attribute_matcher.rb +7 -4
  49. data/lib/shoulda/matchers/active_record/serialize_matcher.rb +4 -2
  50. data/lib/shoulda/matchers/integrations/test_unit.rb +3 -3
  51. data/lib/shoulda/matchers/rails_shim.rb +14 -6
  52. data/lib/shoulda/matchers/version.rb +1 -1
  53. data/spec/shoulda/matchers/action_controller/filter_param_matcher_spec.rb +1 -1
  54. data/spec/shoulda/matchers/action_controller/rescue_from_matcher_spec.rb +2 -2
  55. data/spec/shoulda/matchers/action_controller/route_matcher_spec.rb +5 -0
  56. data/spec/shoulda/matchers/action_controller/route_params_spec.rb +30 -0
  57. data/spec/shoulda/matchers/active_model/allow_mass_assignment_of_matcher_spec.rb +1 -1
  58. data/spec/shoulda/matchers/active_model/allow_value_matcher_spec.rb +1 -1
  59. data/spec/shoulda/matchers/active_model/disallow_value_matcher_spec.rb +2 -2
  60. data/spec/shoulda/matchers/active_model/ensure_inclusion_of_matcher_spec.rb +10 -0
  61. data/spec/shoulda/matchers/active_model/ensure_length_of_matcher_spec.rb +7 -0
  62. data/spec/shoulda/matchers/active_model/{comparison_matcher_spec.rb → numericality_matchers/comparison_matcher_spec.rb} +2 -2
  63. data/spec/shoulda/matchers/active_model/{odd_even_number_matcher_spec.rb → numericality_matchers/odd_even_number_matcher_spec.rb} +4 -4
  64. data/spec/shoulda/matchers/active_model/{only_integer_matcher_spec.rb → numericality_matchers/only_integer_matcher_spec.rb} +3 -3
  65. data/spec/shoulda/matchers/active_model/validate_absence_of_matcher_spec.rb +139 -0
  66. data/spec/shoulda/matchers/active_model/validate_numericality_of_matcher_spec.rb +7 -7
  67. data/spec/shoulda/matchers/active_model/validate_uniqueness_of_matcher_spec.rb +48 -38
  68. data/spec/shoulda/matchers/active_record/accept_nested_attributes_for_matcher_spec.rb +6 -6
  69. data/spec/shoulda/matchers/active_record/association_matcher_spec.rb +21 -8
  70. data/spec/shoulda/matchers/active_record/association_matchers/model_reflection_spec.rb +247 -0
  71. data/spec/shoulda/matchers/active_record/have_readonly_attributes_matcher_spec.rb +1 -1
  72. data/spec/shoulda/matchers/active_record/serialize_matcher_spec.rb +3 -3
  73. data/spec/spec_helper.rb +9 -15
  74. data/spec/support/active_resource_builder.rb +2 -0
  75. data/spec/support/controller_builder.rb +4 -10
  76. data/spec/support/model_builder.rb +6 -2
  77. data/spec/support/rails_versions.rb +18 -0
  78. data/spec/support/shared_examples/numerical_submatcher_spec.rb +4 -4
  79. data/spec/support/test_application.rb +97 -0
  80. metadata +30 -14
  81. data/lib/shoulda/matchers/active_model/comparison_matcher.rb +0 -57
  82. data/lib/shoulda/matchers/active_model/odd_even_number_matcher.rb +0 -47
  83. data/lib/shoulda/matchers/active_model/only_integer_matcher.rb +0 -37
@@ -154,7 +154,7 @@ module FileHelpers
154
154
  end
155
155
 
156
156
  def rails_4?
157
- match = ORIGINAL_BUNDLE_VARS['BUNDLE_GEMFILE'].match(/(\d)\.\d\.gemfile$/)
157
+ match = ORIGINAL_BUNDLE_VARS['BUNDLE_GEMFILE'].match(/(\d)\.\d\.(\d\.)?gemfile$/)
158
158
  match.captures[0] == '4'
159
159
  end
160
160
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- shoulda-matchers (2.4.0.rc1)
4
+ shoulda-matchers (2.5.0)
5
5
  activesupport (>= 3.0.0)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- shoulda-matchers (2.4.0.rc1)
4
+ shoulda-matchers (2.5.0)
5
5
  activesupport (>= 3.0.0)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- shoulda-matchers (2.4.0)
4
+ shoulda-matchers (2.5.0)
5
5
  activesupport (>= 3.0.0)
6
6
 
7
7
  GEM
@@ -9,11 +9,11 @@ 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", "4.0.0"
13
- gem "bcrypt-ruby", "~> 3.0.0"
14
12
  gem "jquery-rails"
15
- gem "sass-rails", "~> 4.0.0"
16
- gem "activeresource", :require=>"active_resource"
13
+ gem "activeresource", "4.0.0"
17
14
  gem "protected_attributes"
15
+ gem "rails", "4.0.0"
16
+ gem "sass-rails", "4.0.0"
17
+ gem "bcrypt-ruby", "~> 3.0.0"
18
18
 
19
19
  gemspec :path=>"../"
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- shoulda-matchers (2.4.0)
4
+ shoulda-matchers (2.5.0)
5
5
  activesupport (>= 3.0.0)
6
6
 
7
7
  GEM
@@ -38,28 +38,28 @@ GEM
38
38
  appraisal (0.5.2)
39
39
  bundler
40
40
  rake
41
- arel (4.0.0)
41
+ arel (4.0.1)
42
42
  aruba (0.5.3)
43
43
  childprocess (>= 0.3.6)
44
44
  cucumber (>= 1.1.1)
45
45
  rspec-expectations (>= 2.7.0)
46
- atomic (1.1.13)
46
+ atomic (1.1.14)
47
47
  bcrypt-ruby (3.0.1)
48
48
  bourne (1.5.0)
49
49
  mocha (>= 0.13.2, < 0.15)
50
50
  builder (3.1.4)
51
51
  childprocess (0.3.9)
52
52
  ffi (~> 1.0, >= 1.0.11)
53
- cucumber (1.3.6)
53
+ cucumber (1.3.10)
54
54
  builder (>= 2.1.2)
55
55
  diff-lcs (>= 1.1.3)
56
- gherkin (~> 2.12.0)
57
- multi_json (~> 1.7.5)
56
+ gherkin (~> 2.12)
57
+ multi_json (>= 1.7.5, < 2.0)
58
58
  multi_test (>= 0.0.2)
59
- diff-lcs (1.2.4)
59
+ diff-lcs (1.2.5)
60
60
  erubis (2.7.0)
61
- ffi (1.9.0)
62
- gherkin (2.12.1)
61
+ ffi (1.9.3)
62
+ gherkin (2.12.2)
63
63
  multi_json (~> 1.3)
64
64
  hike (1.2.3)
65
65
  i18n (0.6.5)
@@ -70,11 +70,11 @@ GEM
70
70
  mime-types (~> 1.16)
71
71
  treetop (~> 1.4.8)
72
72
  metaclass (0.0.1)
73
- mime-types (1.24)
73
+ mime-types (1.25.1)
74
74
  minitest (4.7.5)
75
75
  mocha (0.14.0)
76
76
  metaclass (~> 0.0.1)
77
- multi_json (1.7.9)
77
+ multi_json (1.8.2)
78
78
  multi_test (0.0.2)
79
79
  polyglot (0.3.3)
80
80
  protected_attributes (1.0.3)
@@ -98,10 +98,10 @@ GEM
98
98
  rake (>= 0.8.7)
99
99
  thor (>= 0.18.1, < 2.0)
100
100
  rake (10.1.0)
101
- rspec-core (2.14.5)
102
- rspec-expectations (2.14.2)
101
+ rspec-core (2.14.7)
102
+ rspec-expectations (2.14.4)
103
103
  diff-lcs (>= 1.1.3, < 2.0)
104
- rspec-mocks (2.14.3)
104
+ rspec-mocks (2.14.4)
105
105
  rspec-rails (2.14.0)
106
106
  actionpack (>= 3.0)
107
107
  activesupport (>= 3.0)
@@ -109,30 +109,30 @@ GEM
109
109
  rspec-core (~> 2.14.0)
110
110
  rspec-expectations (~> 2.14.0)
111
111
  rspec-mocks (~> 2.14.0)
112
- sass (3.2.10)
112
+ sass (3.2.12)
113
113
  sass-rails (4.0.0)
114
114
  railties (>= 4.0.0.beta, < 5.0)
115
115
  sass (>= 3.1.10)
116
116
  sprockets-rails (~> 2.0.0)
117
- shoulda-context (1.1.4)
118
- sprockets (2.10.0)
117
+ shoulda-context (1.1.6)
118
+ sprockets (2.10.1)
119
119
  hike (~> 1.2)
120
120
  multi_json (~> 1.0)
121
121
  rack (~> 1.0)
122
122
  tilt (~> 1.1, != 1.3.0)
123
- sprockets-rails (2.0.0)
123
+ sprockets-rails (2.0.1)
124
124
  actionpack (>= 3.0)
125
125
  activesupport (>= 3.0)
126
126
  sprockets (~> 2.8)
127
- sqlite3 (1.3.7)
127
+ sqlite3 (1.3.8)
128
128
  thor (0.18.1)
129
- thread_safe (0.1.2)
129
+ thread_safe (0.1.3)
130
130
  atomic
131
131
  tilt (1.4.1)
132
- treetop (1.4.14)
132
+ treetop (1.4.15)
133
133
  polyglot
134
134
  polyglot (>= 0.3.1)
135
- tzinfo (0.3.37)
135
+ tzinfo (0.3.38)
136
136
 
137
137
  PLATFORMS
138
138
  ruby
@@ -140,7 +140,7 @@ PLATFORMS
140
140
  DEPENDENCIES
141
141
  activerecord-jdbc-adapter
142
142
  activerecord-jdbcsqlite3-adapter
143
- activeresource
143
+ activeresource (= 4.0.0)
144
144
  appraisal (~> 0.4)
145
145
  aruba
146
146
  bcrypt-ruby (~> 3.0.0)
@@ -154,7 +154,7 @@ DEPENDENCIES
154
154
  rails (= 4.0.0)
155
155
  rake (>= 0.9.2)
156
156
  rspec-rails (>= 2.13.1, < 3)
157
- sass-rails (~> 4.0.0)
157
+ sass-rails (= 4.0.0)
158
158
  shoulda-context (~> 1.1.2)
159
159
  shoulda-matchers!
160
160
  sqlite3
@@ -0,0 +1,19 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "shoulda-context", "~> 1.1.2"
6
+ gem "sqlite3", :platform=>:ruby
7
+ gem "activerecord-jdbc-adapter", :platform=>:jruby
8
+ gem "activerecord-jdbcsqlite3-adapter", :platform=>:jruby
9
+ gem "jdbc-sqlite3", :platform=>:jruby
10
+ gem "jruby-openssl", :platform=>:jruby
11
+ gem "therubyrhino", :platform=>:jruby
12
+ gem "jquery-rails"
13
+ gem "activeresource", "4.0.0"
14
+ gem "protected_attributes"
15
+ gem "rails", "4.0.1"
16
+ gem "sass-rails", "4.0.1"
17
+ gem "bcrypt-ruby", "~> 3.1.2"
18
+
19
+ gemspec :path=>"../"
@@ -0,0 +1,161 @@
1
+ PATH
2
+ remote: ../
3
+ specs:
4
+ shoulda-matchers (2.5.0)
5
+ activesupport (>= 3.0.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actionmailer (4.0.1)
11
+ actionpack (= 4.0.1)
12
+ mail (~> 2.5.4)
13
+ actionpack (4.0.1)
14
+ activesupport (= 4.0.1)
15
+ builder (~> 3.1.0)
16
+ erubis (~> 2.7.0)
17
+ rack (~> 1.5.2)
18
+ rack-test (~> 0.6.2)
19
+ activemodel (4.0.1)
20
+ activesupport (= 4.0.1)
21
+ builder (~> 3.1.0)
22
+ activerecord (4.0.1)
23
+ activemodel (= 4.0.1)
24
+ activerecord-deprecated_finders (~> 1.0.2)
25
+ activesupport (= 4.0.1)
26
+ arel (~> 4.0.0)
27
+ activerecord-deprecated_finders (1.0.3)
28
+ activeresource (4.0.0)
29
+ activemodel (~> 4.0)
30
+ activesupport (~> 4.0)
31
+ rails-observers (~> 0.1.1)
32
+ activesupport (4.0.1)
33
+ i18n (~> 0.6, >= 0.6.4)
34
+ minitest (~> 4.2)
35
+ multi_json (~> 1.3)
36
+ thread_safe (~> 0.1)
37
+ tzinfo (~> 0.3.37)
38
+ appraisal (0.5.2)
39
+ bundler
40
+ rake
41
+ arel (4.0.1)
42
+ aruba (0.5.3)
43
+ childprocess (>= 0.3.6)
44
+ cucumber (>= 1.1.1)
45
+ rspec-expectations (>= 2.7.0)
46
+ atomic (1.1.14)
47
+ bcrypt-ruby (3.1.2)
48
+ bourne (1.5.0)
49
+ mocha (>= 0.13.2, < 0.15)
50
+ builder (3.1.4)
51
+ childprocess (0.3.9)
52
+ ffi (~> 1.0, >= 1.0.11)
53
+ cucumber (1.3.10)
54
+ builder (>= 2.1.2)
55
+ diff-lcs (>= 1.1.3)
56
+ gherkin (~> 2.12)
57
+ multi_json (>= 1.7.5, < 2.0)
58
+ multi_test (>= 0.0.2)
59
+ diff-lcs (1.2.5)
60
+ erubis (2.7.0)
61
+ ffi (1.9.3)
62
+ gherkin (2.12.2)
63
+ multi_json (~> 1.3)
64
+ hike (1.2.3)
65
+ i18n (0.6.5)
66
+ jquery-rails (3.0.4)
67
+ railties (>= 3.0, < 5.0)
68
+ thor (>= 0.14, < 2.0)
69
+ mail (2.5.4)
70
+ mime-types (~> 1.16)
71
+ treetop (~> 1.4.8)
72
+ metaclass (0.0.1)
73
+ mime-types (1.25.1)
74
+ minitest (4.7.5)
75
+ mocha (0.14.0)
76
+ metaclass (~> 0.0.1)
77
+ multi_json (1.8.2)
78
+ multi_test (0.0.2)
79
+ polyglot (0.3.3)
80
+ protected_attributes (1.0.5)
81
+ activemodel (>= 4.0.1, < 5.0)
82
+ rack (1.5.2)
83
+ rack-test (0.6.2)
84
+ rack (>= 1.0)
85
+ rails (4.0.1)
86
+ actionmailer (= 4.0.1)
87
+ actionpack (= 4.0.1)
88
+ activerecord (= 4.0.1)
89
+ activesupport (= 4.0.1)
90
+ bundler (>= 1.3.0, < 2.0)
91
+ railties (= 4.0.1)
92
+ sprockets-rails (~> 2.0.0)
93
+ rails-observers (0.1.2)
94
+ activemodel (~> 4.0)
95
+ railties (4.0.1)
96
+ actionpack (= 4.0.1)
97
+ activesupport (= 4.0.1)
98
+ rake (>= 0.8.7)
99
+ thor (>= 0.18.1, < 2.0)
100
+ rake (10.1.0)
101
+ rspec-core (2.14.7)
102
+ rspec-expectations (2.14.4)
103
+ diff-lcs (>= 1.1.3, < 2.0)
104
+ rspec-mocks (2.14.4)
105
+ rspec-rails (2.14.0)
106
+ actionpack (>= 3.0)
107
+ activesupport (>= 3.0)
108
+ railties (>= 3.0)
109
+ rspec-core (~> 2.14.0)
110
+ rspec-expectations (~> 2.14.0)
111
+ rspec-mocks (~> 2.14.0)
112
+ sass (3.2.12)
113
+ sass-rails (4.0.1)
114
+ railties (>= 4.0.0, < 5.0)
115
+ sass (>= 3.1.10)
116
+ sprockets-rails (~> 2.0.0)
117
+ shoulda-context (1.1.6)
118
+ sprockets (2.10.1)
119
+ hike (~> 1.2)
120
+ multi_json (~> 1.0)
121
+ rack (~> 1.0)
122
+ tilt (~> 1.1, != 1.3.0)
123
+ sprockets-rails (2.0.1)
124
+ actionpack (>= 3.0)
125
+ activesupport (>= 3.0)
126
+ sprockets (~> 2.8)
127
+ sqlite3 (1.3.8)
128
+ thor (0.18.1)
129
+ thread_safe (0.1.3)
130
+ atomic
131
+ tilt (1.4.1)
132
+ treetop (1.4.15)
133
+ polyglot
134
+ polyglot (>= 0.3.1)
135
+ tzinfo (0.3.38)
136
+
137
+ PLATFORMS
138
+ ruby
139
+
140
+ DEPENDENCIES
141
+ activerecord-jdbc-adapter
142
+ activerecord-jdbcsqlite3-adapter
143
+ activeresource (= 4.0.0)
144
+ appraisal (~> 0.4)
145
+ aruba
146
+ bcrypt-ruby (~> 3.1.2)
147
+ bourne (~> 1.3)
148
+ bundler (~> 1.1)
149
+ cucumber (~> 1.1)
150
+ jdbc-sqlite3
151
+ jquery-rails
152
+ jruby-openssl
153
+ protected_attributes
154
+ rails (= 4.0.1)
155
+ rake (>= 0.9.2)
156
+ rspec-rails (>= 2.13.1, < 3)
157
+ sass-rails (= 4.0.1)
158
+ shoulda-context (~> 1.1.2)
159
+ shoulda-matchers!
160
+ sqlite3
161
+ therubyrhino
@@ -1,4 +1,5 @@
1
1
  require 'shoulda/matchers/action_controller/filter_param_matcher'
2
+ require 'shoulda/matchers/action_controller/route_params'
2
3
  require 'shoulda/matchers/action_controller/set_the_flash_matcher'
3
4
  require 'shoulda/matchers/action_controller/render_with_layout_matcher'
4
5
  require 'shoulda/matchers/action_controller/respond_with_matcher'
@@ -19,13 +19,15 @@ module Shoulda # :nodoc:
19
19
  filters_key?
20
20
  end
21
21
 
22
- def failure_message_for_should
22
+ def failure_message
23
23
  "Expected #{@key} to be filtered; filtered keys: #{filtered_keys.join(', ')}"
24
24
  end
25
+ alias failure_message_for_should failure_message
25
26
 
26
- def failure_message_for_should_not
27
+ def failure_message_when_negated
27
28
  "Did not expect #{@key} to be filtered"
28
29
  end
30
+ alias failure_message_for_should_not failure_message_when_negated
29
31
 
30
32
  def description
31
33
  "filter #{@key}"
@@ -12,7 +12,10 @@ module Shoulda # :nodoc:
12
12
  end
13
13
 
14
14
  class RedirectToMatcher # :nodoc:
15
- attr_reader :failure_message_for_should, :failure_message_for_should_not
15
+ attr_reader :failure_message, :failure_message_when_negated
16
+
17
+ alias failure_message_for_should failure_message
18
+ alias failure_message_for_should_not failure_message_when_negated
16
19
 
17
20
  def initialize(url_or_description, context, &block)
18
21
  if block
@@ -44,10 +47,10 @@ module Shoulda # :nodoc:
44
47
  def redirects_to_url?
45
48
  begin
46
49
  @context.send(:assert_redirected_to, url)
47
- @failure_message_for_should_not = "Didn't expect to redirect to #{url}"
50
+ @failure_message_when_negated = "Didn't expect to redirect to #{url}"
48
51
  true
49
52
  rescue Shoulda::Matchers::AssertionError => error
50
- @failure_message_for_should = error.message
53
+ @failure_message = error.message
51
54
  false
52
55
  end
53
56
  end
@@ -20,7 +20,10 @@ module Shoulda # :nodoc:
20
20
  end
21
21
 
22
22
  class RenderTemplateMatcher # :nodoc:
23
- attr_reader :failure_message_for_should, :failure_message_for_should_not
23
+ attr_reader :failure_message, :failure_message_when_negated
24
+
25
+ alias failure_message_for_should failure_message
26
+ alias failure_message_for_should_not failure_message_when_negated
24
27
 
25
28
  def initialize(options, message, context)
26
29
  @options = options
@@ -48,10 +51,10 @@ module Shoulda # :nodoc:
48
51
  def renders_template?
49
52
  begin
50
53
  @context.send(:assert_template, @options, @message)
51
- @failure_message_for_should_not = "Didn't expect to render #{@template}"
54
+ @failure_message_when_negated = "Didn't expect to render #{@template}"
52
55
  true
53
56
  rescue Shoulda::Matchers::AssertionError => error
54
- @failure_message_for_should = error.message
57
+ @failure_message = error.message
55
58
  false
56
59
  end
57
60
  end
@@ -33,13 +33,15 @@ module Shoulda # :nodoc:
33
33
  rendered_with_layout? && rendered_with_expected_layout?
34
34
  end
35
35
 
36
- def failure_message_for_should
36
+ def failure_message
37
37
  "Expected #{expectation}, but #{result}"
38
38
  end
39
+ alias failure_message_for_should failure_message
39
40
 
40
- def failure_message_for_should_not
41
+ def failure_message_when_negated
41
42
  "Did not expect #{expectation}, but #{result}"
42
43
  end
44
+ alias failure_message_for_should_not failure_message_when_negated
43
45
 
44
46
  def description
45
47
  description = 'render with '