shoulda 3.6.0 → 4.0.0.rc1

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.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/.rubocop.yml +181 -2
  4. data/.ruby-version +1 -0
  5. data/.travis.yml +24 -9
  6. data/Appraisals +108 -10
  7. data/Gemfile +9 -5
  8. data/README.md +24 -17
  9. data/Rakefile +18 -13
  10. data/gemfiles/rails_4_2.gemfile +31 -0
  11. data/gemfiles/rails_4_2.gemfile.lock +240 -0
  12. data/gemfiles/rails_5_0.gemfile +29 -0
  13. data/gemfiles/rails_5_0.gemfile.lock +232 -0
  14. data/gemfiles/rails_5_1.gemfile +30 -0
  15. data/gemfiles/rails_5_1.gemfile.lock +249 -0
  16. data/gemfiles/rails_5_2.gemfile +32 -0
  17. data/gemfiles/rails_5_2.gemfile.lock +268 -0
  18. data/gemfiles/rails_6_0.gemfile +34 -0
  19. data/gemfiles/rails_6_0.gemfile.lock +285 -0
  20. data/lib/shoulda/version.rb +1 -1
  21. data/script/install_gems_in_all_appraisals +16 -0
  22. data/script/run_all_tests +16 -0
  23. data/script/supported_ruby_versions +7 -0
  24. data/script/update_gem_in_all_appraisals +17 -0
  25. data/script/update_gems_in_all_appraisals +16 -0
  26. data/shoulda.gemspec +3 -3
  27. data/test/acceptance/integrates_with_rails_test.rb +580 -0
  28. data/test/acceptance_test_helper.rb +32 -6
  29. data/test/support/acceptance/add_shoulda_to_project.rb +13 -18
  30. data/test/support/acceptance/matchers/have_output.rb +2 -0
  31. data/test/support/acceptance/matchers/indicate_that_tests_were_run.rb +109 -0
  32. data/test/support/acceptance/rails_application_with_shoulda.rb +47 -0
  33. data/test/support/{tests/current_bundle.rb → current_bundle.rb} +4 -4
  34. data/test/support/snowglobe.rb +5 -0
  35. data/test/test_helper.rb +9 -4
  36. metadata +37 -65
  37. data/.hound/ruby.yml +0 -1042
  38. data/gemfiles/4.2.gemfile +0 -17
  39. data/gemfiles/4.2.gemfile.lock +0 -174
  40. data/gemfiles/5.0.gemfile +0 -17
  41. data/gemfiles/5.0.gemfile.lock +0 -179
  42. data/test/acceptance/rails_integration_test.rb +0 -76
  43. data/test/report_warnings.rb +0 -7
  44. data/test/support/acceptance/helpers.rb +0 -19
  45. data/test/support/acceptance/helpers/active_model_helpers.rb +0 -11
  46. data/test/support/acceptance/helpers/base_helpers.rb +0 -14
  47. data/test/support/acceptance/helpers/command_helpers.rb +0 -54
  48. data/test/support/acceptance/helpers/file_helpers.rb +0 -19
  49. data/test/support/acceptance/helpers/gem_helpers.rb +0 -31
  50. data/test/support/acceptance/helpers/step_helpers.rb +0 -69
  51. data/test/support/acceptance/matchers/indicate_number_of_tests_was_run_matcher.rb +0 -54
  52. data/test/support/acceptance/matchers/indicate_that_tests_were_run_matcher.rb +0 -75
  53. data/test/support/tests/bundle.rb +0 -94
  54. data/test/support/tests/command_runner.rb +0 -230
  55. data/test/support/tests/filesystem.rb +0 -100
  56. data/test/support/tests/version.rb +0 -45
  57. data/test/warnings_spy.rb +0 -62
  58. data/test/warnings_spy/filesystem.rb +0 -45
  59. data/test/warnings_spy/partitioner.rb +0 -36
  60. data/test/warnings_spy/reader.rb +0 -53
  61. data/test/warnings_spy/reporter.rb +0 -88
@@ -1,17 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "appraisal", "~> 2.1"
6
- gem "rails", "4.2.10"
7
- gem "pry"
8
- gem "pry-byebug"
9
- gem "sqlite3"
10
- gem "minitest", "~> 5.0"
11
- gem "minitest-reporters", "~> 1.0"
12
- gem "m"
13
- gem "listen"
14
- gem "sass-rails"
15
- gem "rspec", "~> 3.0"
16
- gem "shoulda-context"
17
- gem "shoulda-matchers", "~> 3.0"
@@ -1,174 +0,0 @@
1
- GEM
2
- remote: https://rubygems.org/
3
- specs:
4
- actionmailer (4.2.10)
5
- actionpack (= 4.2.10)
6
- actionview (= 4.2.10)
7
- activejob (= 4.2.10)
8
- mail (~> 2.5, >= 2.5.4)
9
- rails-dom-testing (~> 1.0, >= 1.0.5)
10
- actionpack (4.2.10)
11
- actionview (= 4.2.10)
12
- activesupport (= 4.2.10)
13
- rack (~> 1.6)
14
- rack-test (~> 0.6.2)
15
- rails-dom-testing (~> 1.0, >= 1.0.5)
16
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
17
- actionview (4.2.10)
18
- activesupport (= 4.2.10)
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.3)
23
- activejob (4.2.10)
24
- activesupport (= 4.2.10)
25
- globalid (>= 0.3.0)
26
- activemodel (4.2.10)
27
- activesupport (= 4.2.10)
28
- builder (~> 3.1)
29
- activerecord (4.2.10)
30
- activemodel (= 4.2.10)
31
- activesupport (= 4.2.10)
32
- arel (~> 6.0)
33
- activesupport (4.2.10)
34
- i18n (~> 0.7)
35
- minitest (~> 5.1)
36
- thread_safe (~> 0.3, >= 0.3.4)
37
- tzinfo (~> 1.1)
38
- ansi (1.5.0)
39
- appraisal (2.1.0)
40
- bundler
41
- rake
42
- thor (>= 0.14.0)
43
- arel (6.0.4)
44
- builder (3.2.3)
45
- byebug (9.0.6)
46
- coderay (1.1.2)
47
- concurrent-ruby (1.0.4)
48
- crass (1.0.4)
49
- diff-lcs (1.3)
50
- erubis (2.7.0)
51
- ffi (1.9.17)
52
- globalid (0.4.1)
53
- activesupport (>= 4.2.0)
54
- i18n (0.9.5)
55
- concurrent-ruby (~> 1.0)
56
- listen (3.1.5)
57
- rb-fsevent (~> 0.9, >= 0.9.4)
58
- rb-inotify (~> 0.9, >= 0.9.7)
59
- ruby_dep (~> 1.2)
60
- loofah (2.2.2)
61
- crass (~> 1.0.2)
62
- nokogiri (>= 1.5.9)
63
- m (1.5.0)
64
- method_source (>= 0.6.7)
65
- rake (>= 0.9.2.2)
66
- mail (2.7.0)
67
- mini_mime (>= 0.1.1)
68
- method_source (0.8.2)
69
- mini_mime (1.0.0)
70
- mini_portile2 (2.3.0)
71
- minitest (5.10.1)
72
- minitest-reporters (1.1.14)
73
- ansi
74
- builder
75
- minitest (>= 5.0)
76
- ruby-progressbar
77
- nokogiri (1.8.4)
78
- mini_portile2 (~> 2.3.0)
79
- pry (0.11.0)
80
- coderay (~> 1.1.0)
81
- method_source (~> 0.8.1)
82
- pry-byebug (3.4.2)
83
- byebug (~> 9.0)
84
- pry (~> 0.10)
85
- rack (1.6.5)
86
- rack-test (0.6.3)
87
- rack (>= 1.0)
88
- rails (4.2.10)
89
- actionmailer (= 4.2.10)
90
- actionpack (= 4.2.10)
91
- actionview (= 4.2.10)
92
- activejob (= 4.2.10)
93
- activemodel (= 4.2.10)
94
- activerecord (= 4.2.10)
95
- activesupport (= 4.2.10)
96
- bundler (>= 1.3.0, < 2.0)
97
- railties (= 4.2.10)
98
- sprockets-rails
99
- rails-deprecated_sanitizer (1.0.3)
100
- activesupport (>= 4.2.0.alpha)
101
- rails-dom-testing (1.0.9)
102
- activesupport (>= 4.2.0, < 5.0)
103
- nokogiri (~> 1.6)
104
- rails-deprecated_sanitizer (>= 1.0.1)
105
- rails-html-sanitizer (1.0.4)
106
- loofah (~> 2.2, >= 2.2.2)
107
- railties (4.2.10)
108
- actionpack (= 4.2.10)
109
- activesupport (= 4.2.10)
110
- rake (>= 0.8.7)
111
- thor (>= 0.18.1, < 2.0)
112
- rake (12.0.0)
113
- rb-fsevent (0.9.8)
114
- rb-inotify (0.9.8)
115
- ffi (>= 0.5.0)
116
- rspec (3.5.0)
117
- rspec-core (~> 3.5.0)
118
- rspec-expectations (~> 3.5.0)
119
- rspec-mocks (~> 3.5.0)
120
- rspec-core (3.5.4)
121
- rspec-support (~> 3.5.0)
122
- rspec-expectations (3.5.0)
123
- diff-lcs (>= 1.2.0, < 2.0)
124
- rspec-support (~> 3.5.0)
125
- rspec-mocks (3.5.0)
126
- diff-lcs (>= 1.2.0, < 2.0)
127
- rspec-support (~> 3.5.0)
128
- rspec-support (3.5.0)
129
- ruby-progressbar (1.8.1)
130
- ruby_dep (1.5.0)
131
- sass (3.4.23)
132
- sass-rails (5.0.6)
133
- railties (>= 4.0.0, < 6)
134
- sass (~> 3.1)
135
- sprockets (>= 2.8, < 4.0)
136
- sprockets-rails (>= 2.0, < 4.0)
137
- tilt (>= 1.1, < 3)
138
- shoulda-context (1.2.2)
139
- shoulda-matchers (3.1.1)
140
- activesupport (>= 4.0.0)
141
- sprockets (3.7.1)
142
- concurrent-ruby (~> 1.0)
143
- rack (> 1, < 3)
144
- sprockets-rails (3.2.0)
145
- actionpack (>= 4.0)
146
- activesupport (>= 4.0)
147
- sprockets (>= 3.0.0)
148
- sqlite3 (1.3.13)
149
- thor (0.19.4)
150
- thread_safe (0.3.6)
151
- tilt (2.0.6)
152
- tzinfo (1.2.5)
153
- thread_safe (~> 0.1)
154
-
155
- PLATFORMS
156
- ruby
157
-
158
- DEPENDENCIES
159
- appraisal (~> 2.1)
160
- listen
161
- m
162
- minitest (~> 5.0)
163
- minitest-reporters (~> 1.0)
164
- pry
165
- pry-byebug
166
- rails (= 4.2.10)
167
- rspec (~> 3.0)
168
- sass-rails
169
- shoulda-context
170
- shoulda-matchers (~> 3.0)
171
- sqlite3
172
-
173
- BUNDLED WITH
174
- 1.16.2
@@ -1,17 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "appraisal", "~> 2.1"
6
- gem "rails", "5.0.1"
7
- gem "pry"
8
- gem "pry-byebug"
9
- gem "sqlite3"
10
- gem "minitest", "~> 5.0"
11
- gem "minitest-reporters", "~> 1.0"
12
- gem "m"
13
- gem "listen"
14
- gem "sass-rails"
15
- gem "rspec", "~> 3.0"
16
- gem "shoulda-context"
17
- gem "shoulda-matchers", "~> 3.0"
@@ -1,179 +0,0 @@
1
- GEM
2
- remote: https://rubygems.org/
3
- specs:
4
- actioncable (5.0.1)
5
- actionpack (= 5.0.1)
6
- nio4r (~> 1.2)
7
- websocket-driver (~> 0.6.1)
8
- actionmailer (5.0.1)
9
- actionpack (= 5.0.1)
10
- actionview (= 5.0.1)
11
- activejob (= 5.0.1)
12
- mail (~> 2.5, >= 2.5.4)
13
- rails-dom-testing (~> 2.0)
14
- actionpack (5.0.1)
15
- actionview (= 5.0.1)
16
- activesupport (= 5.0.1)
17
- rack (~> 2.0)
18
- rack-test (~> 0.6.3)
19
- rails-dom-testing (~> 2.0)
20
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
21
- actionview (5.0.1)
22
- activesupport (= 5.0.1)
23
- builder (~> 3.1)
24
- erubis (~> 2.7.0)
25
- rails-dom-testing (~> 2.0)
26
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
27
- activejob (5.0.1)
28
- activesupport (= 5.0.1)
29
- globalid (>= 0.3.6)
30
- activemodel (5.0.1)
31
- activesupport (= 5.0.1)
32
- activerecord (5.0.1)
33
- activemodel (= 5.0.1)
34
- activesupport (= 5.0.1)
35
- arel (~> 7.0)
36
- activesupport (5.0.1)
37
- concurrent-ruby (~> 1.0, >= 1.0.2)
38
- i18n (~> 0.7)
39
- minitest (~> 5.1)
40
- tzinfo (~> 1.1)
41
- ansi (1.5.0)
42
- appraisal (2.1.0)
43
- bundler
44
- rake
45
- thor (>= 0.14.0)
46
- arel (7.1.4)
47
- builder (3.2.3)
48
- byebug (9.0.6)
49
- coderay (1.1.2)
50
- concurrent-ruby (1.0.4)
51
- diff-lcs (1.3)
52
- erubis (2.7.0)
53
- ffi (1.9.17)
54
- globalid (0.3.7)
55
- activesupport (>= 4.1.0)
56
- i18n (0.7.0)
57
- listen (3.1.5)
58
- rb-fsevent (~> 0.9, >= 0.9.4)
59
- rb-inotify (~> 0.9, >= 0.9.7)
60
- ruby_dep (~> 1.2)
61
- loofah (2.0.3)
62
- nokogiri (>= 1.5.9)
63
- m (1.5.0)
64
- method_source (>= 0.6.7)
65
- rake (>= 0.9.2.2)
66
- mail (2.6.4)
67
- mime-types (>= 1.16, < 4)
68
- method_source (0.8.2)
69
- mime-types (3.1)
70
- mime-types-data (~> 3.2015)
71
- mime-types-data (3.2016.0521)
72
- mini_portile2 (2.1.0)
73
- minitest (5.10.1)
74
- minitest-reporters (1.1.14)
75
- ansi
76
- builder
77
- minitest (>= 5.0)
78
- ruby-progressbar
79
- nio4r (1.2.1)
80
- nokogiri (1.7.0.1)
81
- mini_portile2 (~> 2.1.0)
82
- pry (0.11.0)
83
- coderay (~> 1.1.0)
84
- method_source (~> 0.8.1)
85
- pry-byebug (3.4.2)
86
- byebug (~> 9.0)
87
- pry (~> 0.10)
88
- rack (2.0.1)
89
- rack-test (0.6.3)
90
- rack (>= 1.0)
91
- rails (5.0.1)
92
- actioncable (= 5.0.1)
93
- actionmailer (= 5.0.1)
94
- actionpack (= 5.0.1)
95
- actionview (= 5.0.1)
96
- activejob (= 5.0.1)
97
- activemodel (= 5.0.1)
98
- activerecord (= 5.0.1)
99
- activesupport (= 5.0.1)
100
- bundler (>= 1.3.0, < 2.0)
101
- railties (= 5.0.1)
102
- sprockets-rails (>= 2.0.0)
103
- rails-dom-testing (2.0.2)
104
- activesupport (>= 4.2.0, < 6.0)
105
- nokogiri (~> 1.6)
106
- rails-html-sanitizer (1.0.3)
107
- loofah (~> 2.0)
108
- railties (5.0.1)
109
- actionpack (= 5.0.1)
110
- activesupport (= 5.0.1)
111
- method_source
112
- rake (>= 0.8.7)
113
- thor (>= 0.18.1, < 2.0)
114
- rake (12.0.0)
115
- rb-fsevent (0.9.8)
116
- rb-inotify (0.9.8)
117
- ffi (>= 0.5.0)
118
- rspec (3.5.0)
119
- rspec-core (~> 3.5.0)
120
- rspec-expectations (~> 3.5.0)
121
- rspec-mocks (~> 3.5.0)
122
- rspec-core (3.5.4)
123
- rspec-support (~> 3.5.0)
124
- rspec-expectations (3.5.0)
125
- diff-lcs (>= 1.2.0, < 2.0)
126
- rspec-support (~> 3.5.0)
127
- rspec-mocks (3.5.0)
128
- diff-lcs (>= 1.2.0, < 2.0)
129
- rspec-support (~> 3.5.0)
130
- rspec-support (3.5.0)
131
- ruby-progressbar (1.8.1)
132
- ruby_dep (1.5.0)
133
- sass (3.4.23)
134
- sass-rails (5.0.6)
135
- railties (>= 4.0.0, < 6)
136
- sass (~> 3.1)
137
- sprockets (>= 2.8, < 4.0)
138
- sprockets-rails (>= 2.0, < 4.0)
139
- tilt (>= 1.1, < 3)
140
- shoulda-context (1.2.2)
141
- shoulda-matchers (3.1.1)
142
- activesupport (>= 4.0.0)
143
- sprockets (3.7.1)
144
- concurrent-ruby (~> 1.0)
145
- rack (> 1, < 3)
146
- sprockets-rails (3.2.0)
147
- actionpack (>= 4.0)
148
- activesupport (>= 4.0)
149
- sprockets (>= 3.0.0)
150
- sqlite3 (1.3.13)
151
- thor (0.19.4)
152
- thread_safe (0.3.5)
153
- tilt (2.0.6)
154
- tzinfo (1.2.2)
155
- thread_safe (~> 0.1)
156
- websocket-driver (0.6.5)
157
- websocket-extensions (>= 0.1.0)
158
- websocket-extensions (0.1.2)
159
-
160
- PLATFORMS
161
- ruby
162
-
163
- DEPENDENCIES
164
- appraisal (~> 2.1)
165
- listen
166
- m
167
- minitest (~> 5.0)
168
- minitest-reporters (~> 1.0)
169
- pry
170
- pry-byebug
171
- rails (= 5.0.1)
172
- rspec (~> 3.0)
173
- sass-rails
174
- shoulda-context
175
- shoulda-matchers (~> 3.0)
176
- sqlite3
177
-
178
- BUNDLED WITH
179
- 1.16.2
@@ -1,76 +0,0 @@
1
- require 'acceptance_test_helper'
2
-
3
- class ShouldaIntegratesWithRailsTest < AcceptanceTest
4
- def test_works_in_a_project_that_uses_minitest
5
- create_rails_application
6
-
7
- write_file 'db/migrate/1_create_users.rb', <<-FILE
8
- class CreateUsers < ActiveRecord::Migration
9
- def self.up
10
- create_table :users do |t|
11
- t.string :name
12
- end
13
- end
14
- end
15
- FILE
16
-
17
- run_rake_tasks!(['db:drop', 'db:create', 'db:migrate'])
18
-
19
- write_file 'app/models/user.rb', <<-FILE
20
- class User < ActiveRecord::Base
21
- validates_presence_of :name
22
- end
23
- FILE
24
-
25
- write_file 'app/controllers/examples_controller.rb', <<-FILE
26
- class ExamplesController < ApplicationController
27
- def index
28
- @example = 'hello'
29
- render nothing: true
30
- end
31
- end
32
- FILE
33
-
34
- write_file 'config/routes.rb', <<-FILE
35
- Rails.application.routes.draw do
36
- resources :examples, only: [:index]
37
- end
38
- FILE
39
-
40
- updating_bundle do
41
- add_shoulda_to_project(
42
- test_frameworks: [:minitest],
43
- libraries: [:rails],
44
- )
45
- end
46
-
47
- write_file 'test/unit/user_test.rb', <<-FILE
48
- require 'test_helper'
49
-
50
- class UserTest < ActiveSupport::TestCase
51
- should validate_presence_of(:name)
52
- end
53
- FILE
54
-
55
- write_file 'test/functional/examples_controller_test.rb', <<-FILE
56
- require 'test_helper'
57
-
58
- class ExamplesControllerTest < ActionController::TestCase
59
- def setup
60
- get :index
61
- end
62
-
63
- should respond_with(:success)
64
- end
65
- FILE
66
-
67
- result = run_n_unit_test_suite
68
-
69
- assert_accepts indicate_that_tests_were_run(unit: 1, functional: 1), result
70
- assert_accepts(
71
- have_output('User should validate that :name cannot be empty/falsy'),
72
- result,
73
- )
74
- assert_accepts have_output('should respond with 200'), result
75
- end
76
- end