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.
- checksums.yaml +4 -4
- data/.travis.yml +13 -3
- data/Appraisals +18 -0
- data/CONTRIBUTING.md +13 -29
- data/Gemfile +1 -4
- data/Gemfile.lock +2 -10
- data/NEWS.md +100 -14
- data/README.md +62 -58
- data/Rakefile +9 -16
- data/gemfiles/3.0.gemfile +11 -12
- data/gemfiles/3.0.gemfile.lock +15 -10
- data/gemfiles/3.1.gemfile +11 -12
- data/gemfiles/3.1.gemfile.lock +14 -10
- data/gemfiles/3.1_1.9.2.gemfile +12 -11
- data/gemfiles/3.1_1.9.2.gemfile.lock +14 -3
- data/gemfiles/3.2.gemfile +11 -12
- data/gemfiles/3.2.gemfile.lock +15 -10
- data/gemfiles/3.2_1.9.2.gemfile +12 -11
- data/gemfiles/3.2_1.9.2.gemfile.lock +14 -2
- data/gemfiles/4.0.0.gemfile +10 -12
- data/gemfiles/4.0.0.gemfile.lock +13 -10
- data/gemfiles/4.0.1.gemfile +10 -12
- data/gemfiles/4.0.1.gemfile.lock +13 -10
- data/gemfiles/4.1.gemfile +13 -15
- data/gemfiles/4.1.gemfile.lock +45 -50
- data/gemfiles/4.2.gemfile +36 -0
- data/gemfiles/4.2.gemfile.lock +245 -0
- data/lib/shoulda/matchers.rb +3 -1
- data/lib/shoulda/matchers/action_controller.rb +1 -1
- data/lib/shoulda/matchers/action_controller/redirect_to_matcher.rb +1 -1
- data/lib/shoulda/matchers/action_controller/route_params.rb +9 -4
- data/lib/shoulda/matchers/action_controller/{set_the_flash_matcher.rb → set_flash_matcher.rb} +34 -26
- data/lib/shoulda/matchers/action_controller/set_session_matcher.rb +125 -69
- data/lib/shoulda/matchers/active_model.rb +1 -2
- data/lib/shoulda/matchers/active_model/allow_value_matcher.rb +18 -5
- data/lib/shoulda/matchers/active_model/exception_message_finder.rb +2 -2
- data/lib/shoulda/matchers/active_model/helpers.rb +4 -4
- data/lib/shoulda/matchers/active_model/validate_confirmation_of_matcher.rb +10 -3
- data/lib/shoulda/matchers/active_model/validate_exclusion_of_matcher.rb +1 -1
- data/lib/shoulda/matchers/active_model/validate_inclusion_of_matcher.rb +3 -1
- data/lib/shoulda/matchers/active_model/{ensure_length_of_matcher.rb → validate_length_of_matcher.rb} +30 -20
- data/lib/shoulda/matchers/active_model/validate_presence_of_matcher.rb +21 -0
- data/lib/shoulda/matchers/active_model/validation_message_finder.rb +2 -2
- data/lib/shoulda/matchers/active_record.rb +2 -0
- data/lib/shoulda/matchers/active_record/association_matcher.rb +96 -2
- data/lib/shoulda/matchers/active_record/association_matchers/join_table_matcher.rb +1 -1
- data/lib/shoulda/matchers/active_record/association_matchers/model_reflection.rb +3 -3
- data/lib/shoulda/matchers/active_record/association_matchers/option_verifier.rb +22 -2
- data/lib/shoulda/matchers/active_record/have_db_column_matcher.rb +30 -4
- data/lib/shoulda/matchers/active_record/serialize_matcher.rb +19 -3
- data/lib/shoulda/matchers/active_record/uniqueness.rb +14 -0
- data/lib/shoulda/matchers/active_record/uniqueness/model.rb +45 -0
- data/lib/shoulda/matchers/active_record/uniqueness/namespace.rb +36 -0
- data/lib/shoulda/matchers/active_record/uniqueness/test_model_creator.rb +50 -0
- data/lib/shoulda/matchers/active_record/uniqueness/test_models.rb +24 -0
- data/lib/shoulda/matchers/{active_model → active_record}/validate_uniqueness_of_matcher.rb +76 -16
- data/lib/shoulda/matchers/independent/delegate_method_matcher.rb +117 -51
- data/lib/shoulda/matchers/independent/delegate_method_matcher/target_not_defined_error.rb +1 -1
- data/lib/shoulda/matchers/matcher_context.rb +35 -0
- data/lib/shoulda/matchers/rails_shim.rb +23 -0
- data/lib/shoulda/matchers/util.rb +28 -0
- data/lib/shoulda/matchers/version.rb +1 -1
- data/script/SUPPORTED_VERSIONS +1 -1
- data/spec/acceptance/active_model_integration_spec.rb +20 -0
- data/spec/acceptance/independent_matchers_spec.rb +64 -0
- data/spec/acceptance/rails_integration_spec.rb +142 -0
- data/spec/acceptance_spec_helper.rb +23 -0
- data/spec/support/acceptance/helpers.rb +29 -0
- data/spec/support/acceptance/helpers/active_model_helpers.rb +11 -0
- data/spec/support/acceptance/helpers/array_helpers.rb +13 -0
- data/spec/support/acceptance/helpers/base_helpers.rb +14 -0
- data/spec/support/acceptance/helpers/command_helpers.rb +51 -0
- data/spec/support/acceptance/helpers/file_helpers.rb +19 -0
- data/spec/support/acceptance/helpers/gem_helpers.rb +31 -0
- data/spec/support/acceptance/helpers/minitest_helpers.rb +19 -0
- data/spec/support/acceptance/helpers/pluralization_helpers.rb +13 -0
- data/spec/support/acceptance/helpers/rails_version_helpers.rb +11 -0
- data/spec/support/acceptance/helpers/rspec_helpers.rb +26 -0
- data/spec/support/acceptance/helpers/ruby_version_helpers.rb +9 -0
- data/spec/support/acceptance/helpers/step_helpers.rb +117 -0
- data/spec/support/acceptance/matchers/have_output.rb +31 -0
- data/spec/support/acceptance/matchers/indicate_number_of_tests_was_run_matcher.rb +55 -0
- data/spec/support/acceptance/matchers/indicate_that_tests_were_run_matcher.rb +103 -0
- data/spec/support/tests/bundle.rb +94 -0
- data/spec/support/tests/command_runner.rb +214 -0
- data/spec/support/tests/filesystem.rb +77 -0
- data/spec/support/tests/version.rb +45 -0
- data/spec/support/unit/capture.rb +34 -0
- data/spec/support/unit/helpers/active_model_helpers.rb +25 -0
- data/spec/support/unit/helpers/active_model_versions.rb +20 -0
- data/spec/support/unit/helpers/active_resource_builder.rb +27 -0
- data/spec/support/unit/helpers/allow_value_matcher_helpers.rb +15 -0
- data/spec/support/unit/helpers/class_builder.rb +72 -0
- data/spec/support/unit/helpers/confirmation_matcher_helpers.rb +17 -0
- data/spec/support/unit/helpers/controller_builder.rb +91 -0
- data/spec/support/unit/helpers/i18n_faker.rb +15 -0
- data/spec/support/unit/helpers/mailer_builder.rb +12 -0
- data/spec/support/unit/helpers/model_builder.rb +102 -0
- data/spec/support/unit/helpers/rails_versions.rb +28 -0
- data/spec/support/unit/i18n.rb +7 -0
- data/spec/support/unit/matchers/deprecate.rb +60 -0
- data/spec/support/unit/matchers/fail_with_message_including_matcher.rb +50 -0
- data/spec/support/unit/matchers/fail_with_message_matcher.rb +50 -0
- data/spec/support/unit/matchers/print_warning_including.rb +59 -0
- data/spec/support/unit/rails_application.rb +110 -0
- data/spec/support/unit/record_builder_with_i18n_validation_message.rb +69 -0
- data/spec/support/unit/record_validating_confirmation_builder.rb +56 -0
- data/spec/support/unit/record_with_different_error_attribute_builder.rb +92 -0
- data/spec/support/{shared_examples → unit/shared_examples}/numerical_submatcher.rb +0 -2
- data/spec/support/{shared_examples → unit/shared_examples}/numerical_type_submatcher.rb +0 -2
- data/spec/{shoulda → unit/shoulda}/matchers/action_controller/callback_matcher_spec.rb +2 -2
- data/spec/{shoulda → unit/shoulda}/matchers/action_controller/filter_param_matcher_spec.rb +2 -2
- data/spec/{shoulda → unit/shoulda}/matchers/action_controller/redirect_to_matcher_spec.rb +3 -3
- data/spec/{shoulda → unit/shoulda}/matchers/action_controller/render_template_matcher_spec.rb +2 -4
- data/spec/{shoulda → unit/shoulda}/matchers/action_controller/render_with_layout_matcher_spec.rb +9 -6
- data/spec/{shoulda → unit/shoulda}/matchers/action_controller/rescue_from_matcher_spec.rb +2 -2
- data/spec/{shoulda → unit/shoulda}/matchers/action_controller/respond_with_matcher_spec.rb +2 -2
- data/spec/unit/shoulda/matchers/action_controller/route_matcher_spec.rb +126 -0
- data/spec/{shoulda → unit/shoulda}/matchers/action_controller/route_params_spec.rb +2 -2
- data/spec/unit/shoulda/matchers/action_controller/set_flash_matcher_spec.rb +167 -0
- data/spec/unit/shoulda/matchers/action_controller/set_session_matcher_spec.rb +294 -0
- data/spec/{shoulda → unit/shoulda}/matchers/action_controller/strong_parameters_matcher_spec.rb +19 -11
- data/spec/{shoulda → unit/shoulda}/matchers/active_model/allow_mass_assignment_of_matcher_spec.rb +2 -2
- data/spec/{shoulda → unit/shoulda}/matchers/active_model/allow_value_matcher_spec.rb +49 -21
- data/spec/{shoulda → unit/shoulda}/matchers/active_model/disallow_value_matcher_spec.rb +8 -4
- data/spec/{shoulda → unit/shoulda}/matchers/active_model/exception_message_finder_spec.rb +4 -4
- data/spec/{shoulda → unit/shoulda}/matchers/active_model/have_secure_password_matcher_spec.rb +2 -2
- data/spec/{shoulda → unit/shoulda}/matchers/active_model/helpers_spec.rb +7 -3
- data/spec/{shoulda → unit/shoulda}/matchers/active_model/numericality_matchers/comparison_matcher_spec.rb +1 -1
- data/spec/{shoulda → unit/shoulda}/matchers/active_model/numericality_matchers/even_number_matcher_spec.rb +1 -1
- data/spec/{shoulda → unit/shoulda}/matchers/active_model/numericality_matchers/odd_number_matcher_spec.rb +1 -1
- data/spec/{shoulda → unit/shoulda}/matchers/active_model/numericality_matchers/only_integer_matcher_spec.rb +1 -1
- data/spec/{shoulda → unit/shoulda}/matchers/active_model/validate_absence_of_matcher_spec.rb +3 -3
- data/spec/{shoulda → unit/shoulda}/matchers/active_model/validate_acceptance_of_matcher_spec.rb +2 -2
- data/spec/unit/shoulda/matchers/active_model/validate_confirmation_of_matcher_spec.rb +63 -0
- data/spec/{shoulda → unit/shoulda}/matchers/active_model/validate_exclusion_of_matcher_spec.rb +5 -4
- data/spec/{shoulda → unit/shoulda}/matchers/active_model/validate_inclusion_of_matcher_spec.rb +7 -14
- 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
- data/spec/{shoulda → unit/shoulda}/matchers/active_model/validate_numericality_of_matcher_spec.rb +3 -4
- data/spec/{shoulda → unit/shoulda}/matchers/active_model/validate_presence_of_matcher_spec.rb +3 -3
- data/spec/{shoulda → unit/shoulda}/matchers/active_model/validate_uniqueness_of_matcher_spec.rb +127 -2
- data/spec/{shoulda → unit/shoulda}/matchers/active_model/validation_message_finder_spec.rb +8 -6
- data/spec/{shoulda → unit/shoulda}/matchers/active_record/accept_nested_attributes_for_matcher_spec.rb +2 -2
- data/spec/{shoulda → unit/shoulda}/matchers/active_record/association_matcher_spec.rb +217 -26
- data/spec/{shoulda → unit/shoulda}/matchers/active_record/association_matchers/model_reflection_spec.rb +2 -2
- data/spec/{shoulda → unit/shoulda}/matchers/active_record/define_enum_for_matcher_spec.rb +2 -2
- data/spec/{shoulda → unit/shoulda}/matchers/active_record/have_db_column_matcher_spec.rb +2 -2
- data/spec/{shoulda → unit/shoulda}/matchers/active_record/have_db_index_matcher_spec.rb +8 -5
- data/spec/{shoulda → unit/shoulda}/matchers/active_record/have_readonly_attributes_matcher_spec.rb +2 -2
- data/spec/{shoulda → unit/shoulda}/matchers/active_record/serialize_matcher_spec.rb +3 -3
- data/spec/{shoulda → unit/shoulda}/matchers/doublespeak/double_collection_spec.rb +29 -7
- data/spec/{shoulda → unit/shoulda}/matchers/doublespeak/double_implementation_registry_spec.rb +1 -1
- data/spec/{shoulda → unit/shoulda}/matchers/doublespeak/double_spec.rb +20 -10
- data/spec/{shoulda → unit/shoulda}/matchers/doublespeak/object_double_spec.rb +1 -1
- data/spec/{shoulda → unit/shoulda}/matchers/doublespeak/proxy_implementation_spec.rb +13 -6
- data/spec/{shoulda → unit/shoulda}/matchers/doublespeak/stub_implementation_spec.rb +2 -2
- data/spec/unit/shoulda/matchers/doublespeak/world_spec.rb +77 -0
- data/spec/{shoulda → unit/shoulda}/matchers/doublespeak_spec.rb +11 -3
- data/spec/{shoulda → unit/shoulda}/matchers/independent/delegate_method_matcher/stubbed_target_spec.rb +1 -1
- data/spec/unit/shoulda/matchers/independent/delegate_method_matcher_spec.rb +517 -0
- data/spec/unit_spec_helper.rb +66 -0
- data/spec/warnings_spy/partitioner.rb +10 -3
- data/spec/warnings_spy/reader.rb +9 -20
- data/spec/warnings_spy/reporter.rb +2 -1
- metadata +212 -149
- data/features/activemodel_integration.feature +0 -15
- data/features/rails_integration.feature +0 -160
- data/features/step_definitions/activemodel_steps.rb +0 -21
- data/features/step_definitions/rails_steps.rb +0 -227
- data/features/support/env.rb +0 -6
- data/spec/shoulda/matchers/action_controller/route_matcher_spec.rb +0 -70
- data/spec/shoulda/matchers/action_controller/set_session_matcher_spec.rb +0 -113
- data/spec/shoulda/matchers/action_controller/set_the_flash_matcher_spec.rb +0 -153
- data/spec/shoulda/matchers/active_model/validate_confirmation_of_matcher_spec.rb +0 -47
- data/spec/shoulda/matchers/doublespeak/world_spec.rb +0 -70
- data/spec/shoulda/matchers/independent/delegate_method_matcher_spec.rb +0 -309
- data/spec/spec_helper.rb +0 -42
- data/spec/support/active_model_versions.rb +0 -13
- data/spec/support/active_resource_builder.rb +0 -29
- data/spec/support/activemodel_helpers.rb +0 -23
- data/spec/support/capture_helpers.rb +0 -19
- data/spec/support/class_builder.rb +0 -46
- data/spec/support/controller_builder.rb +0 -102
- data/spec/support/fail_with_message_including_matcher.rb +0 -44
- data/spec/support/fail_with_message_matcher.rb +0 -44
- data/spec/support/i18n_faker.rb +0 -10
- data/spec/support/mailer_builder.rb +0 -10
- data/spec/support/model_builder.rb +0 -81
- data/spec/support/rails_versions.rb +0 -26
- 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
|
data/lib/shoulda/matchers.rb
CHANGED
@@ -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/
|
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/
|
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'
|
@@ -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
|
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]
|
34
|
-
|
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
|
|
data/lib/shoulda/matchers/action_controller/{set_the_flash_matcher.rb → set_flash_matcher.rb}
RENAMED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Shoulda
|
2
2
|
module Matchers
|
3
3
|
module ActionController
|
4
|
-
# 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
|
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
|
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
|
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
|
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
|
64
|
-
# it { should_not
|
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
|
74
|
-
# should_not
|
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
|
95
|
-
# it { should
|
96
|
-
# it { should
|
97
|
-
# it { should_not
|
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
|
107
|
-
# should
|
108
|
-
# should
|
109
|
-
# should_not
|
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
|
130
|
-
# it { should
|
131
|
-
# it { should
|
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
|
141
|
-
# should
|
142
|
-
# should
|
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 [
|
146
|
+
# @return [SetFlashMatcher]
|
147
147
|
#
|
148
|
+
def set_flash
|
149
|
+
SetFlashMatcher.new
|
150
|
+
end
|
151
|
+
|
148
152
|
def set_the_flash
|
149
|
-
|
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
|
161
|
+
class SetFlashMatcher
|
154
162
|
def initialize
|
155
163
|
@options = {}
|
156
164
|
@value = nil
|