shoulda-matchers 2.7.0 → 2.8.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (190) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +13 -3
  3. data/Appraisals +18 -0
  4. data/CONTRIBUTING.md +13 -29
  5. data/Gemfile +1 -4
  6. data/Gemfile.lock +2 -10
  7. data/NEWS.md +100 -14
  8. data/README.md +62 -58
  9. data/Rakefile +9 -16
  10. data/gemfiles/3.0.gemfile +11 -12
  11. data/gemfiles/3.0.gemfile.lock +15 -10
  12. data/gemfiles/3.1.gemfile +11 -12
  13. data/gemfiles/3.1.gemfile.lock +14 -10
  14. data/gemfiles/3.1_1.9.2.gemfile +12 -11
  15. data/gemfiles/3.1_1.9.2.gemfile.lock +14 -3
  16. data/gemfiles/3.2.gemfile +11 -12
  17. data/gemfiles/3.2.gemfile.lock +15 -10
  18. data/gemfiles/3.2_1.9.2.gemfile +12 -11
  19. data/gemfiles/3.2_1.9.2.gemfile.lock +14 -2
  20. data/gemfiles/4.0.0.gemfile +10 -12
  21. data/gemfiles/4.0.0.gemfile.lock +13 -10
  22. data/gemfiles/4.0.1.gemfile +10 -12
  23. data/gemfiles/4.0.1.gemfile.lock +13 -10
  24. data/gemfiles/4.1.gemfile +13 -15
  25. data/gemfiles/4.1.gemfile.lock +45 -50
  26. data/gemfiles/4.2.gemfile +36 -0
  27. data/gemfiles/4.2.gemfile.lock +245 -0
  28. data/lib/shoulda/matchers.rb +3 -1
  29. data/lib/shoulda/matchers/action_controller.rb +1 -1
  30. data/lib/shoulda/matchers/action_controller/redirect_to_matcher.rb +1 -1
  31. data/lib/shoulda/matchers/action_controller/route_params.rb +9 -4
  32. data/lib/shoulda/matchers/action_controller/{set_the_flash_matcher.rb → set_flash_matcher.rb} +34 -26
  33. data/lib/shoulda/matchers/action_controller/set_session_matcher.rb +125 -69
  34. data/lib/shoulda/matchers/active_model.rb +1 -2
  35. data/lib/shoulda/matchers/active_model/allow_value_matcher.rb +18 -5
  36. data/lib/shoulda/matchers/active_model/exception_message_finder.rb +2 -2
  37. data/lib/shoulda/matchers/active_model/helpers.rb +4 -4
  38. data/lib/shoulda/matchers/active_model/validate_confirmation_of_matcher.rb +10 -3
  39. data/lib/shoulda/matchers/active_model/validate_exclusion_of_matcher.rb +1 -1
  40. data/lib/shoulda/matchers/active_model/validate_inclusion_of_matcher.rb +3 -1
  41. data/lib/shoulda/matchers/active_model/{ensure_length_of_matcher.rb → validate_length_of_matcher.rb} +30 -20
  42. data/lib/shoulda/matchers/active_model/validate_presence_of_matcher.rb +21 -0
  43. data/lib/shoulda/matchers/active_model/validation_message_finder.rb +2 -2
  44. data/lib/shoulda/matchers/active_record.rb +2 -0
  45. data/lib/shoulda/matchers/active_record/association_matcher.rb +96 -2
  46. data/lib/shoulda/matchers/active_record/association_matchers/join_table_matcher.rb +1 -1
  47. data/lib/shoulda/matchers/active_record/association_matchers/model_reflection.rb +3 -3
  48. data/lib/shoulda/matchers/active_record/association_matchers/option_verifier.rb +22 -2
  49. data/lib/shoulda/matchers/active_record/have_db_column_matcher.rb +30 -4
  50. data/lib/shoulda/matchers/active_record/serialize_matcher.rb +19 -3
  51. data/lib/shoulda/matchers/active_record/uniqueness.rb +14 -0
  52. data/lib/shoulda/matchers/active_record/uniqueness/model.rb +45 -0
  53. data/lib/shoulda/matchers/active_record/uniqueness/namespace.rb +36 -0
  54. data/lib/shoulda/matchers/active_record/uniqueness/test_model_creator.rb +50 -0
  55. data/lib/shoulda/matchers/active_record/uniqueness/test_models.rb +24 -0
  56. data/lib/shoulda/matchers/{active_model → active_record}/validate_uniqueness_of_matcher.rb +76 -16
  57. data/lib/shoulda/matchers/independent/delegate_method_matcher.rb +117 -51
  58. data/lib/shoulda/matchers/independent/delegate_method_matcher/target_not_defined_error.rb +1 -1
  59. data/lib/shoulda/matchers/matcher_context.rb +35 -0
  60. data/lib/shoulda/matchers/rails_shim.rb +23 -0
  61. data/lib/shoulda/matchers/util.rb +28 -0
  62. data/lib/shoulda/matchers/version.rb +1 -1
  63. data/script/SUPPORTED_VERSIONS +1 -1
  64. data/spec/acceptance/active_model_integration_spec.rb +20 -0
  65. data/spec/acceptance/independent_matchers_spec.rb +64 -0
  66. data/spec/acceptance/rails_integration_spec.rb +142 -0
  67. data/spec/acceptance_spec_helper.rb +23 -0
  68. data/spec/support/acceptance/helpers.rb +29 -0
  69. data/spec/support/acceptance/helpers/active_model_helpers.rb +11 -0
  70. data/spec/support/acceptance/helpers/array_helpers.rb +13 -0
  71. data/spec/support/acceptance/helpers/base_helpers.rb +14 -0
  72. data/spec/support/acceptance/helpers/command_helpers.rb +51 -0
  73. data/spec/support/acceptance/helpers/file_helpers.rb +19 -0
  74. data/spec/support/acceptance/helpers/gem_helpers.rb +31 -0
  75. data/spec/support/acceptance/helpers/minitest_helpers.rb +19 -0
  76. data/spec/support/acceptance/helpers/pluralization_helpers.rb +13 -0
  77. data/spec/support/acceptance/helpers/rails_version_helpers.rb +11 -0
  78. data/spec/support/acceptance/helpers/rspec_helpers.rb +26 -0
  79. data/spec/support/acceptance/helpers/ruby_version_helpers.rb +9 -0
  80. data/spec/support/acceptance/helpers/step_helpers.rb +117 -0
  81. data/spec/support/acceptance/matchers/have_output.rb +31 -0
  82. data/spec/support/acceptance/matchers/indicate_number_of_tests_was_run_matcher.rb +55 -0
  83. data/spec/support/acceptance/matchers/indicate_that_tests_were_run_matcher.rb +103 -0
  84. data/spec/support/tests/bundle.rb +94 -0
  85. data/spec/support/tests/command_runner.rb +214 -0
  86. data/spec/support/tests/filesystem.rb +77 -0
  87. data/spec/support/tests/version.rb +45 -0
  88. data/spec/support/unit/capture.rb +34 -0
  89. data/spec/support/unit/helpers/active_model_helpers.rb +25 -0
  90. data/spec/support/unit/helpers/active_model_versions.rb +20 -0
  91. data/spec/support/unit/helpers/active_resource_builder.rb +27 -0
  92. data/spec/support/unit/helpers/allow_value_matcher_helpers.rb +15 -0
  93. data/spec/support/unit/helpers/class_builder.rb +72 -0
  94. data/spec/support/unit/helpers/confirmation_matcher_helpers.rb +17 -0
  95. data/spec/support/unit/helpers/controller_builder.rb +91 -0
  96. data/spec/support/unit/helpers/i18n_faker.rb +15 -0
  97. data/spec/support/unit/helpers/mailer_builder.rb +12 -0
  98. data/spec/support/unit/helpers/model_builder.rb +102 -0
  99. data/spec/support/unit/helpers/rails_versions.rb +28 -0
  100. data/spec/support/unit/i18n.rb +7 -0
  101. data/spec/support/unit/matchers/deprecate.rb +60 -0
  102. data/spec/support/unit/matchers/fail_with_message_including_matcher.rb +50 -0
  103. data/spec/support/unit/matchers/fail_with_message_matcher.rb +50 -0
  104. data/spec/support/unit/matchers/print_warning_including.rb +59 -0
  105. data/spec/support/unit/rails_application.rb +110 -0
  106. data/spec/support/unit/record_builder_with_i18n_validation_message.rb +69 -0
  107. data/spec/support/unit/record_validating_confirmation_builder.rb +56 -0
  108. data/spec/support/unit/record_with_different_error_attribute_builder.rb +92 -0
  109. data/spec/support/{shared_examples → unit/shared_examples}/numerical_submatcher.rb +0 -2
  110. data/spec/support/{shared_examples → unit/shared_examples}/numerical_type_submatcher.rb +0 -2
  111. data/spec/{shoulda → unit/shoulda}/matchers/action_controller/callback_matcher_spec.rb +2 -2
  112. data/spec/{shoulda → unit/shoulda}/matchers/action_controller/filter_param_matcher_spec.rb +2 -2
  113. data/spec/{shoulda → unit/shoulda}/matchers/action_controller/redirect_to_matcher_spec.rb +3 -3
  114. data/spec/{shoulda → unit/shoulda}/matchers/action_controller/render_template_matcher_spec.rb +2 -4
  115. data/spec/{shoulda → unit/shoulda}/matchers/action_controller/render_with_layout_matcher_spec.rb +9 -6
  116. data/spec/{shoulda → unit/shoulda}/matchers/action_controller/rescue_from_matcher_spec.rb +2 -2
  117. data/spec/{shoulda → unit/shoulda}/matchers/action_controller/respond_with_matcher_spec.rb +2 -2
  118. data/spec/unit/shoulda/matchers/action_controller/route_matcher_spec.rb +126 -0
  119. data/spec/{shoulda → unit/shoulda}/matchers/action_controller/route_params_spec.rb +2 -2
  120. data/spec/unit/shoulda/matchers/action_controller/set_flash_matcher_spec.rb +167 -0
  121. data/spec/unit/shoulda/matchers/action_controller/set_session_matcher_spec.rb +294 -0
  122. data/spec/{shoulda → unit/shoulda}/matchers/action_controller/strong_parameters_matcher_spec.rb +19 -11
  123. data/spec/{shoulda → unit/shoulda}/matchers/active_model/allow_mass_assignment_of_matcher_spec.rb +2 -2
  124. data/spec/{shoulda → unit/shoulda}/matchers/active_model/allow_value_matcher_spec.rb +49 -21
  125. data/spec/{shoulda → unit/shoulda}/matchers/active_model/disallow_value_matcher_spec.rb +8 -4
  126. data/spec/{shoulda → unit/shoulda}/matchers/active_model/exception_message_finder_spec.rb +4 -4
  127. data/spec/{shoulda → unit/shoulda}/matchers/active_model/have_secure_password_matcher_spec.rb +2 -2
  128. data/spec/{shoulda → unit/shoulda}/matchers/active_model/helpers_spec.rb +7 -3
  129. data/spec/{shoulda → unit/shoulda}/matchers/active_model/numericality_matchers/comparison_matcher_spec.rb +1 -1
  130. data/spec/{shoulda → unit/shoulda}/matchers/active_model/numericality_matchers/even_number_matcher_spec.rb +1 -1
  131. data/spec/{shoulda → unit/shoulda}/matchers/active_model/numericality_matchers/odd_number_matcher_spec.rb +1 -1
  132. data/spec/{shoulda → unit/shoulda}/matchers/active_model/numericality_matchers/only_integer_matcher_spec.rb +1 -1
  133. data/spec/{shoulda → unit/shoulda}/matchers/active_model/validate_absence_of_matcher_spec.rb +3 -3
  134. data/spec/{shoulda → unit/shoulda}/matchers/active_model/validate_acceptance_of_matcher_spec.rb +2 -2
  135. data/spec/unit/shoulda/matchers/active_model/validate_confirmation_of_matcher_spec.rb +63 -0
  136. data/spec/{shoulda → unit/shoulda}/matchers/active_model/validate_exclusion_of_matcher_spec.rb +5 -4
  137. data/spec/{shoulda → unit/shoulda}/matchers/active_model/validate_inclusion_of_matcher_spec.rb +7 -14
  138. data/spec/{shoulda/matchers/active_model/ensure_length_of_matcher_spec.rb → unit/shoulda/matchers/active_model/validate_length_of_matcher_spec.rb} +43 -23
  139. data/spec/{shoulda → unit/shoulda}/matchers/active_model/validate_numericality_of_matcher_spec.rb +3 -4
  140. data/spec/{shoulda → unit/shoulda}/matchers/active_model/validate_presence_of_matcher_spec.rb +3 -3
  141. data/spec/{shoulda → unit/shoulda}/matchers/active_model/validate_uniqueness_of_matcher_spec.rb +127 -2
  142. data/spec/{shoulda → unit/shoulda}/matchers/active_model/validation_message_finder_spec.rb +8 -6
  143. data/spec/{shoulda → unit/shoulda}/matchers/active_record/accept_nested_attributes_for_matcher_spec.rb +2 -2
  144. data/spec/{shoulda → unit/shoulda}/matchers/active_record/association_matcher_spec.rb +217 -26
  145. data/spec/{shoulda → unit/shoulda}/matchers/active_record/association_matchers/model_reflection_spec.rb +2 -2
  146. data/spec/{shoulda → unit/shoulda}/matchers/active_record/define_enum_for_matcher_spec.rb +2 -2
  147. data/spec/{shoulda → unit/shoulda}/matchers/active_record/have_db_column_matcher_spec.rb +2 -2
  148. data/spec/{shoulda → unit/shoulda}/matchers/active_record/have_db_index_matcher_spec.rb +8 -5
  149. data/spec/{shoulda → unit/shoulda}/matchers/active_record/have_readonly_attributes_matcher_spec.rb +2 -2
  150. data/spec/{shoulda → unit/shoulda}/matchers/active_record/serialize_matcher_spec.rb +3 -3
  151. data/spec/{shoulda → unit/shoulda}/matchers/doublespeak/double_collection_spec.rb +29 -7
  152. data/spec/{shoulda → unit/shoulda}/matchers/doublespeak/double_implementation_registry_spec.rb +1 -1
  153. data/spec/{shoulda → unit/shoulda}/matchers/doublespeak/double_spec.rb +20 -10
  154. data/spec/{shoulda → unit/shoulda}/matchers/doublespeak/object_double_spec.rb +1 -1
  155. data/spec/{shoulda → unit/shoulda}/matchers/doublespeak/proxy_implementation_spec.rb +13 -6
  156. data/spec/{shoulda → unit/shoulda}/matchers/doublespeak/stub_implementation_spec.rb +2 -2
  157. data/spec/unit/shoulda/matchers/doublespeak/world_spec.rb +77 -0
  158. data/spec/{shoulda → unit/shoulda}/matchers/doublespeak_spec.rb +11 -3
  159. data/spec/{shoulda → unit/shoulda}/matchers/independent/delegate_method_matcher/stubbed_target_spec.rb +1 -1
  160. data/spec/unit/shoulda/matchers/independent/delegate_method_matcher_spec.rb +517 -0
  161. data/spec/unit_spec_helper.rb +66 -0
  162. data/spec/warnings_spy/partitioner.rb +10 -3
  163. data/spec/warnings_spy/reader.rb +9 -20
  164. data/spec/warnings_spy/reporter.rb +2 -1
  165. metadata +212 -149
  166. data/features/activemodel_integration.feature +0 -15
  167. data/features/rails_integration.feature +0 -160
  168. data/features/step_definitions/activemodel_steps.rb +0 -21
  169. data/features/step_definitions/rails_steps.rb +0 -227
  170. data/features/support/env.rb +0 -6
  171. data/spec/shoulda/matchers/action_controller/route_matcher_spec.rb +0 -70
  172. data/spec/shoulda/matchers/action_controller/set_session_matcher_spec.rb +0 -113
  173. data/spec/shoulda/matchers/action_controller/set_the_flash_matcher_spec.rb +0 -153
  174. data/spec/shoulda/matchers/active_model/validate_confirmation_of_matcher_spec.rb +0 -47
  175. data/spec/shoulda/matchers/doublespeak/world_spec.rb +0 -70
  176. data/spec/shoulda/matchers/independent/delegate_method_matcher_spec.rb +0 -309
  177. data/spec/spec_helper.rb +0 -42
  178. data/spec/support/active_model_versions.rb +0 -13
  179. data/spec/support/active_resource_builder.rb +0 -29
  180. data/spec/support/activemodel_helpers.rb +0 -23
  181. data/spec/support/capture_helpers.rb +0 -19
  182. data/spec/support/class_builder.rb +0 -46
  183. data/spec/support/controller_builder.rb +0 -102
  184. data/spec/support/fail_with_message_including_matcher.rb +0 -44
  185. data/spec/support/fail_with_message_matcher.rb +0 -44
  186. data/spec/support/i18n_faker.rb +0 -10
  187. data/spec/support/mailer_builder.rb +0 -10
  188. data/spec/support/model_builder.rb +0 -81
  189. data/spec/support/rails_versions.rb +0 -26
  190. data/spec/support/test_application.rb +0 -120
@@ -0,0 +1,36 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal", "~> 1.0"
6
+ gem "aruba"
7
+ gem "bourne", "~> 1.3"
8
+ gem "bundler", "~> 1.1"
9
+ gem "pry"
10
+ gem "rails", "~> 4.2.0"
11
+ gem "rake", ">= 0.9.2"
12
+ gem "rspec-rails", "~> 3.0.1"
13
+ gem "yard"
14
+ gem "redcarpet"
15
+ gem "pygments.rb"
16
+ gem "watchr"
17
+ gem "shoulda-context", "~> 1.2.0"
18
+ gem "sqlite3", :platform => :ruby
19
+ gem "activerecord-jdbc-adapter", :platform => :jruby
20
+ gem "activerecord-jdbcsqlite3-adapter", :platform => :jruby
21
+ gem "jdbc-sqlite3", :platform => :jruby
22
+ gem "jruby-openssl", :platform => :jruby
23
+ gem "therubyrhino", :platform => :jruby
24
+ gem "spring"
25
+ gem "spring-commands-rspec"
26
+ gem "uglifier", ">= 1.3.0"
27
+ gem "coffee-rails", "~> 4.0.0"
28
+ gem "jquery-rails"
29
+ gem "turbolinks"
30
+ gem "sdoc", "~> 0.4.0"
31
+ gem "activeresource", "4.0.0"
32
+ gem "protected_attributes", "~> 1.0.6"
33
+ gem "minitest-reporters"
34
+ gem "jbuilder", "~> 2.0"
35
+ gem "sass-rails", "~> 5.0"
36
+ gem "bcrypt", "~> 3.1.7"
@@ -0,0 +1,245 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ actionmailer (4.2.0)
5
+ actionpack (= 4.2.0)
6
+ actionview (= 4.2.0)
7
+ activejob (= 4.2.0)
8
+ mail (~> 2.5, >= 2.5.4)
9
+ rails-dom-testing (~> 1.0, >= 1.0.5)
10
+ actionpack (4.2.0)
11
+ actionview (= 4.2.0)
12
+ activesupport (= 4.2.0)
13
+ rack (~> 1.6.0)
14
+ rack-test (~> 0.6.2)
15
+ rails-dom-testing (~> 1.0, >= 1.0.5)
16
+ rails-html-sanitizer (~> 1.0, >= 1.0.1)
17
+ actionview (4.2.0)
18
+ activesupport (= 4.2.0)
19
+ builder (~> 3.1)
20
+ erubis (~> 2.7.0)
21
+ rails-dom-testing (~> 1.0, >= 1.0.5)
22
+ rails-html-sanitizer (~> 1.0, >= 1.0.1)
23
+ activejob (4.2.0)
24
+ activesupport (= 4.2.0)
25
+ globalid (>= 0.3.0)
26
+ activemodel (4.2.0)
27
+ activesupport (= 4.2.0)
28
+ builder (~> 3.1)
29
+ activerecord (4.2.0)
30
+ activemodel (= 4.2.0)
31
+ activesupport (= 4.2.0)
32
+ arel (~> 6.0)
33
+ activeresource (4.0.0)
34
+ activemodel (~> 4.0)
35
+ activesupport (~> 4.0)
36
+ rails-observers (~> 0.1.1)
37
+ activesupport (4.2.0)
38
+ i18n (~> 0.7)
39
+ json (~> 1.7, >= 1.7.7)
40
+ minitest (~> 5.1)
41
+ thread_safe (~> 0.3, >= 0.3.4)
42
+ tzinfo (~> 1.1)
43
+ ansi (1.4.3)
44
+ appraisal (1.0.2)
45
+ bundler
46
+ rake
47
+ thor (>= 0.14.0)
48
+ arel (6.0.0)
49
+ aruba (0.6.1)
50
+ childprocess (>= 0.3.6)
51
+ cucumber (>= 1.1.1)
52
+ rspec-expectations (>= 2.7.0)
53
+ bcrypt (3.1.9)
54
+ bourne (1.6.0)
55
+ mocha (~> 1.1)
56
+ builder (3.2.2)
57
+ childprocess (0.5.5)
58
+ ffi (~> 1.0, >= 1.0.11)
59
+ coderay (1.1.0)
60
+ coffee-rails (4.0.1)
61
+ coffee-script (>= 2.2.0)
62
+ railties (>= 4.0.0, < 5.0)
63
+ coffee-script (2.3.0)
64
+ coffee-script-source
65
+ execjs
66
+ coffee-script-source (1.8.0)
67
+ cucumber (1.3.17)
68
+ builder (>= 2.1.2)
69
+ diff-lcs (>= 1.1.3)
70
+ gherkin (~> 2.12)
71
+ multi_json (>= 1.7.5, < 2.0)
72
+ multi_test (>= 0.1.1)
73
+ diff-lcs (1.2.5)
74
+ erubis (2.7.0)
75
+ execjs (2.2.2)
76
+ ffi (1.9.6)
77
+ gherkin (2.12.2)
78
+ multi_json (~> 1.3)
79
+ globalid (0.3.0)
80
+ activesupport (>= 4.1.0)
81
+ hike (1.2.3)
82
+ i18n (0.7.0)
83
+ jbuilder (2.2.6)
84
+ activesupport (>= 3.0.0, < 5)
85
+ multi_json (~> 1.2)
86
+ jquery-rails (4.0.2)
87
+ rails-dom-testing (~> 1.0)
88
+ railties (>= 4.2.0)
89
+ thor (>= 0.14, < 2.0)
90
+ json (1.8.1)
91
+ loofah (2.0.1)
92
+ nokogiri (>= 1.5.9)
93
+ mail (2.6.3)
94
+ mime-types (>= 1.16, < 3)
95
+ metaclass (0.0.4)
96
+ method_source (0.8.2)
97
+ mime-types (2.4.3)
98
+ mini_portile (0.6.1)
99
+ minitest (5.5.0)
100
+ minitest-reporters (1.0.8)
101
+ ansi
102
+ builder
103
+ minitest (>= 5.0)
104
+ ruby-progressbar
105
+ mocha (1.1.0)
106
+ metaclass (~> 0.0.1)
107
+ multi_json (1.10.1)
108
+ multi_test (0.1.1)
109
+ nokogiri (1.6.5)
110
+ mini_portile (~> 0.6.0)
111
+ posix-spawn (0.3.9)
112
+ protected_attributes (1.0.8)
113
+ activemodel (>= 4.0.1, < 5.0)
114
+ pry (0.10.1)
115
+ coderay (~> 1.1.0)
116
+ method_source (~> 0.8.1)
117
+ slop (~> 3.4)
118
+ pygments.rb (0.6.0)
119
+ posix-spawn (~> 0.3.6)
120
+ yajl-ruby (~> 1.1.0)
121
+ rack (1.6.0)
122
+ rack-test (0.6.2)
123
+ rack (>= 1.0)
124
+ rails (4.2.0)
125
+ actionmailer (= 4.2.0)
126
+ actionpack (= 4.2.0)
127
+ actionview (= 4.2.0)
128
+ activejob (= 4.2.0)
129
+ activemodel (= 4.2.0)
130
+ activerecord (= 4.2.0)
131
+ activesupport (= 4.2.0)
132
+ bundler (>= 1.3.0, < 2.0)
133
+ railties (= 4.2.0)
134
+ sprockets-rails
135
+ rails-deprecated_sanitizer (1.0.3)
136
+ activesupport (>= 4.2.0.alpha)
137
+ rails-dom-testing (1.0.5)
138
+ activesupport (>= 4.2.0.beta, < 5.0)
139
+ nokogiri (~> 1.6.0)
140
+ rails-deprecated_sanitizer (>= 1.0.1)
141
+ rails-html-sanitizer (1.0.1)
142
+ loofah (~> 2.0)
143
+ rails-observers (0.1.2)
144
+ activemodel (~> 4.0)
145
+ railties (4.2.0)
146
+ actionpack (= 4.2.0)
147
+ activesupport (= 4.2.0)
148
+ rake (>= 0.8.7)
149
+ thor (>= 0.18.1, < 2.0)
150
+ rake (10.4.2)
151
+ rdoc (4.2.0)
152
+ json (~> 1.4)
153
+ redcarpet (3.2.2)
154
+ rspec-core (3.0.4)
155
+ rspec-support (~> 3.0.0)
156
+ rspec-expectations (3.0.4)
157
+ diff-lcs (>= 1.2.0, < 2.0)
158
+ rspec-support (~> 3.0.0)
159
+ rspec-mocks (3.0.4)
160
+ rspec-support (~> 3.0.0)
161
+ rspec-rails (3.0.2)
162
+ actionpack (>= 3.0)
163
+ activesupport (>= 3.0)
164
+ railties (>= 3.0)
165
+ rspec-core (~> 3.0.0)
166
+ rspec-expectations (~> 3.0.0)
167
+ rspec-mocks (~> 3.0.0)
168
+ rspec-support (~> 3.0.0)
169
+ rspec-support (3.0.4)
170
+ ruby-progressbar (1.7.1)
171
+ sass (3.4.9)
172
+ sass-rails (5.0.0)
173
+ railties (>= 4.0.0, < 5.0)
174
+ sass (~> 3.1)
175
+ sprockets (>= 2.8, < 4.0)
176
+ sprockets-rails (>= 2.0, < 4.0)
177
+ tilt (~> 1.1)
178
+ sdoc (0.4.1)
179
+ json (~> 1.7, >= 1.7.7)
180
+ rdoc (~> 4.0)
181
+ shoulda-context (1.2.1)
182
+ slop (3.6.0)
183
+ spring (1.2.0)
184
+ spring-commands-rspec (1.0.4)
185
+ spring (>= 0.9.1)
186
+ sprockets (2.12.3)
187
+ hike (~> 1.2)
188
+ multi_json (~> 1.0)
189
+ rack (~> 1.0)
190
+ tilt (~> 1.1, != 1.3.0)
191
+ sprockets-rails (2.2.2)
192
+ actionpack (>= 3.0)
193
+ activesupport (>= 3.0)
194
+ sprockets (>= 2.8, < 4.0)
195
+ sqlite3 (1.3.10)
196
+ thor (0.19.1)
197
+ thread_safe (0.3.4)
198
+ tilt (1.4.1)
199
+ turbolinks (2.5.3)
200
+ coffee-rails
201
+ tzinfo (1.2.2)
202
+ thread_safe (~> 0.1)
203
+ uglifier (2.6.0)
204
+ execjs (>= 0.3.0)
205
+ json (>= 1.8.0)
206
+ watchr (0.7)
207
+ yajl-ruby (1.1.0)
208
+ yard (0.8.7.6)
209
+
210
+ PLATFORMS
211
+ ruby
212
+
213
+ DEPENDENCIES
214
+ activerecord-jdbc-adapter
215
+ activerecord-jdbcsqlite3-adapter
216
+ activeresource (= 4.0.0)
217
+ appraisal (~> 1.0)
218
+ aruba
219
+ bcrypt (~> 3.1.7)
220
+ bourne (~> 1.3)
221
+ bundler (~> 1.1)
222
+ coffee-rails (~> 4.0.0)
223
+ jbuilder (~> 2.0)
224
+ jdbc-sqlite3
225
+ jquery-rails
226
+ jruby-openssl
227
+ minitest-reporters
228
+ protected_attributes (~> 1.0.6)
229
+ pry
230
+ pygments.rb
231
+ rails (~> 4.2.0)
232
+ rake (>= 0.9.2)
233
+ redcarpet
234
+ rspec-rails (~> 3.0.1)
235
+ sass-rails (~> 5.0)
236
+ sdoc (~> 0.4.0)
237
+ shoulda-context (~> 1.2.0)
238
+ spring
239
+ spring-commands-rspec
240
+ sqlite3
241
+ therubyrhino
242
+ turbolinks
243
+ uglifier (>= 1.3.0)
244
+ watchr
245
+ yard
@@ -1,9 +1,11 @@
1
1
  require 'shoulda/matchers/assertion_error'
2
2
  require 'shoulda/matchers/doublespeak'
3
3
  require 'shoulda/matchers/error'
4
+ require 'shoulda/matchers/matcher_context'
4
5
  require 'shoulda/matchers/rails_shim'
5
- require 'shoulda/matchers/warn'
6
+ require 'shoulda/matchers/util'
6
7
  require 'shoulda/matchers/version'
8
+ require 'shoulda/matchers/warn'
7
9
 
8
10
  require 'shoulda/matchers/independent'
9
11
 
@@ -1,6 +1,6 @@
1
1
  require 'shoulda/matchers/action_controller/filter_param_matcher'
2
2
  require 'shoulda/matchers/action_controller/route_params'
3
- require 'shoulda/matchers/action_controller/set_the_flash_matcher'
3
+ require 'shoulda/matchers/action_controller/set_flash_matcher'
4
4
  require 'shoulda/matchers/action_controller/render_with_layout_matcher'
5
5
  require 'shoulda/matchers/action_controller/respond_with_matcher'
6
6
  require 'shoulda/matchers/action_controller/set_session_matcher'
@@ -72,7 +72,7 @@ module Shoulda
72
72
  end
73
73
 
74
74
  def description
75
- "redirect to #{@location}"
75
+ "redirect to #{@location.inspect}"
76
76
  end
77
77
 
78
78
  private
@@ -24,14 +24,19 @@ module Shoulda
24
24
  end
25
25
 
26
26
  def extract_params_from_string
27
- params = args[1] || {}
28
27
  controller, action = args[0].split('#')
29
- params.merge!(controller: controller, action: action)
28
+ params = (args[1] || {}).merge(controller: controller, action: action)
29
+ stringify_values(params)
30
30
  end
31
31
 
32
32
  def stringify_params
33
- args[0].each do |key, value|
34
- args[0][key] = stringify(value)
33
+ stringify_values(args[0])
34
+ end
35
+
36
+ def stringify_values(hash)
37
+ hash.inject({}) do |hash_copy, (key, value)|
38
+ hash_copy[key] = stringify(value)
39
+ hash_copy
35
40
  end
36
41
  end
37
42
 
@@ -1,7 +1,7 @@
1
1
  module Shoulda
2
2
  module Matchers
3
3
  module ActionController
4
- # The `set_the_flash` matcher is used to make assertions about the
4
+ # The `set_flash` matcher is used to make assertions about the
5
5
  # `flash` hash.
6
6
  #
7
7
  # class PostsController < ApplicationController
@@ -18,13 +18,13 @@ module Shoulda
18
18
  # describe 'GET #index' do
19
19
  # before { get :index }
20
20
  #
21
- # it { should set_the_flash }
21
+ # it { should set_flash }
22
22
  # end
23
23
  #
24
24
  # describe 'DELETE #destroy' do
25
25
  # before { delete :destroy }
26
26
  #
27
- # it { should_not set_the_flash }
27
+ # it { should_not set_flash }
28
28
  # end
29
29
  # end
30
30
  #
@@ -33,13 +33,13 @@ module Shoulda
33
33
  # context 'GET #index' do
34
34
  # setup { get :index }
35
35
  #
36
- # should set_the_flash
36
+ # should set_flash
37
37
  # end
38
38
  #
39
39
  # context 'DELETE #destroy' do
40
40
  # setup { delete :destroy }
41
41
  #
42
- # should_not set_the_flash
42
+ # should_not set_flash
43
43
  # end
44
44
  # end
45
45
  #
@@ -60,8 +60,8 @@ module Shoulda
60
60
  # describe 'GET #index' do
61
61
  # before { get :index }
62
62
  #
63
- # it { should set_the_flash[:foo] }
64
- # it { should_not set_the_flash[:bar] }
63
+ # it { should set_flash[:foo] }
64
+ # it { should_not set_flash[:bar] }
65
65
  # end
66
66
  # end
67
67
  #
@@ -70,8 +70,8 @@ module Shoulda
70
70
  # context 'GET #index' do
71
71
  # setup { get :show }
72
72
  #
73
- # should set_the_flash[:foo]
74
- # should_not set_the_flash[:bar]
73
+ # should set_flash[:foo]
74
+ # should_not set_flash[:bar]
75
75
  # end
76
76
  # end
77
77
  #
@@ -91,10 +91,10 @@ module Shoulda
91
91
  # describe 'GET #index' do
92
92
  # before { get :index }
93
93
  #
94
- # it { should set_the_flash.to('A candy bar') }
95
- # it { should set_the_flash.to(/bar/) }
96
- # it { should set_the_flash[:foo].to('bar') }
97
- # it { should_not set_the_flash[:foo].to('something else') }
94
+ # it { should set_flash.to('A candy bar') }
95
+ # it { should set_flash.to(/bar/) }
96
+ # it { should set_flash[:foo].to('bar') }
97
+ # it { should_not set_flash[:foo].to('something else') }
98
98
  # end
99
99
  # end
100
100
  #
@@ -103,10 +103,10 @@ module Shoulda
103
103
  # context 'GET #index' do
104
104
  # setup { get :show }
105
105
  #
106
- # should set_the_flash.to('A candy bar')
107
- # should set_the_flash.to(/bar/)
108
- # should set_the_flash[:foo].to('bar')
109
- # should_not set_the_flash[:foo].to('something else')
106
+ # should set_flash.to('A candy bar')
107
+ # should set_flash.to(/bar/)
108
+ # should set_flash[:foo].to('bar')
109
+ # should_not set_flash[:foo].to('something else')
110
110
  # end
111
111
  # end
112
112
  #
@@ -126,9 +126,9 @@ module Shoulda
126
126
  # describe 'GET #show' do
127
127
  # before { get :show }
128
128
  #
129
- # it { should set_the_flash.now }
130
- # it { should set_the_flash[:foo].now }
131
- # it { should set_the_flash[:foo].to('bar').now }
129
+ # it { should set_flash.now }
130
+ # it { should set_flash[:foo].now }
131
+ # it { should set_flash[:foo].to('bar').now }
132
132
  # end
133
133
  # end
134
134
  #
@@ -137,20 +137,28 @@ module Shoulda
137
137
  # context 'GET #index' do
138
138
  # setup { get :show }
139
139
  #
140
- # should set_the_flash.now
141
- # should set_the_flash[:foo].now
142
- # should set_the_flash[:foo].to('bar').now
140
+ # should set_flash.now
141
+ # should set_flash[:foo].now
142
+ # should set_flash[:foo].to('bar').now
143
143
  # end
144
144
  # end
145
145
  #
146
- # @return [SetTheFlashMatcher]
146
+ # @return [SetFlashMatcher]
147
147
  #
148
+ def set_flash
149
+ SetFlashMatcher.new
150
+ end
151
+
148
152
  def set_the_flash
149
- SetTheFlashMatcher.new
153
+ Shoulda::Matchers.warn_about_deprecated_method(
154
+ :set_the_flash,
155
+ :set_flash
156
+ )
157
+ set_flash
150
158
  end
151
159
 
152
160
  # @private
153
- class SetTheFlashMatcher
161
+ class SetFlashMatcher
154
162
  def initialize
155
163
  @options = {}
156
164
  @value = nil