minitest-spec-rails 5.4.0 → 5.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +26 -0
  3. data/.travis.yml +8 -5
  4. data/Appraisals +9 -2
  5. data/CHANGELOG.md +5 -1
  6. data/Gemfile +0 -1
  7. data/README.md +17 -28
  8. data/Rakefile +4 -5
  9. data/gemfiles/rails41.gemfile.lock +44 -45
  10. data/gemfiles/rails42.gemfile.lock +64 -67
  11. data/gemfiles/rails50.gemfile +2 -1
  12. data/gemfiles/rails50.gemfile.lock +75 -80
  13. data/gemfiles/rails51.gemfile +8 -0
  14. data/gemfiles/rails51.gemfile.lock +128 -0
  15. data/lib/minitest-spec-rails/dsl.rb +5 -9
  16. data/lib/minitest-spec-rails/init/action_controller.rb +3 -7
  17. data/lib/minitest-spec-rails/init/action_dispatch.rb +1 -3
  18. data/lib/minitest-spec-rails/init/action_mailer.rb +2 -7
  19. data/lib/minitest-spec-rails/init/action_view.rb +1 -5
  20. data/lib/minitest-spec-rails/init/active_job.rb +3 -8
  21. data/lib/minitest-spec-rails/init/active_support.rb +8 -10
  22. data/lib/minitest-spec-rails/init/mini_shoulda.rb +2 -6
  23. data/lib/minitest-spec-rails/railtie.rb +21 -21
  24. data/lib/minitest-spec-rails/version.rb +1 -1
  25. data/minitest-spec-rails.gemspec +5 -5
  26. data/test/cases/action_controller_test.rb +7 -10
  27. data/test/cases/action_dispatch_test.rb +10 -13
  28. data/test/cases/action_mailer_test.rb +7 -10
  29. data/test/cases/action_view_test.rb +13 -16
  30. data/test/cases/active_job_test.rb +38 -36
  31. data/test/cases/active_support_test.rb +22 -12
  32. data/test/cases/mini_shoulda_test.rb +0 -4
  33. data/test/dummy_app/app/controllers/application_controller.rb +1 -3
  34. data/test/dummy_app/app/controllers/users_controller.rb +1 -3
  35. data/test/dummy_app/app/helpers/application_helper.rb +0 -1
  36. data/test/dummy_app/app/helpers/foos_helper.rb +3 -1
  37. data/test/dummy_app/app/helpers/users_helper.rb +1 -3
  38. data/test/dummy_app/app/mailers/user_mailer.rb +2 -4
  39. data/test/dummy_app/app/models/post.rb +0 -3
  40. data/test/dummy_app/app/models/user.rb +0 -3
  41. data/test/dummy_app/config/routes.rb +1 -1
  42. data/test/dummy_app/init.rb +2 -4
  43. data/test/dummy_tests/application_controller_test.rb +3 -9
  44. data/test/dummy_tests/foos_helper_test.rb +0 -3
  45. data/test/dummy_tests/integration_test.rb +2 -8
  46. data/test/dummy_tests/special_users_controller_test.rb +0 -2
  47. data/test/dummy_tests/user_mailer_test.rb +4 -10
  48. data/test/dummy_tests/user_test.rb +2 -8
  49. data/test/dummy_tests/users_controller_test.rb +1 -3
  50. data/test/dummy_tests/users_helper_test.rb +2 -8
  51. data/test/support/shared_test_case_behavior.rb +4 -7
  52. data/test/test_helper.rb +0 -3
  53. data/test/test_helper_dummy.rb +5 -6
  54. metadata +8 -4
@@ -2,6 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "5.0.0.rc1"
5
+ gem "rails", "5.0.0"
6
+ gem "minitest", "5.10.1"
6
7
 
7
8
  gemspec :path => "../"
@@ -1,133 +1,128 @@
1
1
  PATH
2
- remote: ../
2
+ remote: ..
3
3
  specs:
4
- minitest-spec-rails (5.4.0)
4
+ minitest-spec-rails (5.5.0)
5
5
  minitest (~> 5.0)
6
6
  rails (>= 4.1)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actioncable (5.0.0.rc1)
12
- actionpack (= 5.0.0.rc1)
11
+ actioncable (5.0.0)
12
+ actionpack (= 5.0.0)
13
13
  nio4r (~> 1.2)
14
14
  websocket-driver (~> 0.6.1)
15
- actionmailer (5.0.0.rc1)
16
- actionpack (= 5.0.0.rc1)
17
- actionview (= 5.0.0.rc1)
18
- activejob (= 5.0.0.rc1)
15
+ actionmailer (5.0.0)
16
+ actionpack (= 5.0.0)
17
+ actionview (= 5.0.0)
18
+ activejob (= 5.0.0)
19
19
  mail (~> 2.5, >= 2.5.4)
20
- rails-dom-testing (~> 1.0, >= 1.0.5)
21
- actionpack (5.0.0.rc1)
22
- actionview (= 5.0.0.rc1)
23
- activesupport (= 5.0.0.rc1)
24
- rack (~> 2.x)
20
+ rails-dom-testing (~> 2.0)
21
+ actionpack (5.0.0)
22
+ actionview (= 5.0.0)
23
+ activesupport (= 5.0.0)
24
+ rack (~> 2.0)
25
25
  rack-test (~> 0.6.3)
26
- rails-dom-testing (~> 1.0, >= 1.0.5)
26
+ rails-dom-testing (~> 2.0)
27
27
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
28
- actionview (5.0.0.rc1)
29
- activesupport (= 5.0.0.rc1)
28
+ actionview (5.0.0)
29
+ activesupport (= 5.0.0)
30
30
  builder (~> 3.1)
31
31
  erubis (~> 2.7.0)
32
- rails-dom-testing (~> 1.0, >= 1.0.5)
32
+ rails-dom-testing (~> 2.0)
33
33
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
34
- activejob (5.0.0.rc1)
35
- activesupport (= 5.0.0.rc1)
34
+ activejob (5.0.0)
35
+ activesupport (= 5.0.0)
36
36
  globalid (>= 0.3.6)
37
- activemodel (5.0.0.rc1)
38
- activesupport (= 5.0.0.rc1)
39
- activerecord (5.0.0.rc1)
40
- activemodel (= 5.0.0.rc1)
41
- activesupport (= 5.0.0.rc1)
37
+ activemodel (5.0.0)
38
+ activesupport (= 5.0.0)
39
+ activerecord (5.0.0)
40
+ activemodel (= 5.0.0)
41
+ activesupport (= 5.0.0)
42
42
  arel (~> 7.0)
43
- activesupport (5.0.0.rc1)
43
+ activesupport (5.0.0)
44
44
  concurrent-ruby (~> 1.0, >= 1.0.2)
45
45
  i18n (~> 0.7)
46
46
  minitest (~> 5.1)
47
47
  tzinfo (~> 1.1)
48
- appraisal (2.1.0)
48
+ appraisal (2.2.0)
49
49
  bundler
50
50
  rake
51
51
  thor (>= 0.14.0)
52
- arel (7.0.0)
53
- builder (3.2.2)
54
- concurrent-ruby (1.0.2)
52
+ arel (7.1.4)
53
+ builder (3.2.3)
54
+ concurrent-ruby (1.1.4)
55
+ crass (1.0.4)
55
56
  erubis (2.7.0)
56
- globalid (0.3.6)
57
- activesupport (>= 4.1.0)
58
- i18n (0.7.0)
59
- json (1.8.3)
60
- loofah (2.0.3)
57
+ globalid (0.4.2)
58
+ activesupport (>= 4.2.0)
59
+ i18n (0.9.5)
60
+ concurrent-ruby (~> 1.0)
61
+ loofah (2.2.3)
62
+ crass (~> 1.0.2)
61
63
  nokogiri (>= 1.5.9)
62
- mail (2.6.4)
63
- mime-types (>= 1.16, < 4)
64
- method_source (0.8.2)
65
- mime-types (3.1)
66
- mime-types-data (~> 3.2015)
67
- mime-types-data (3.2016.0521)
68
- mini_portile2 (2.1.0)
69
- minitest (5.9.0)
64
+ mail (2.7.1)
65
+ mini_mime (>= 0.1.1)
66
+ method_source (0.9.2)
67
+ mini_mime (1.0.1)
68
+ mini_portile2 (2.4.0)
69
+ minitest (5.10.1)
70
70
  nio4r (1.2.1)
71
- nokogiri (1.6.8)
72
- mini_portile2 (~> 2.1.0)
73
- pkg-config (~> 1.1.7)
74
- pkg-config (1.1.7)
75
- rack (2.0.0.rc1)
76
- json
71
+ nokogiri (1.9.1)
72
+ mini_portile2 (~> 2.4.0)
73
+ rack (2.0.6)
77
74
  rack-test (0.6.3)
78
75
  rack (>= 1.0)
79
- rails (5.0.0.rc1)
80
- actioncable (= 5.0.0.rc1)
81
- actionmailer (= 5.0.0.rc1)
82
- actionpack (= 5.0.0.rc1)
83
- actionview (= 5.0.0.rc1)
84
- activejob (= 5.0.0.rc1)
85
- activemodel (= 5.0.0.rc1)
86
- activerecord (= 5.0.0.rc1)
87
- activesupport (= 5.0.0.rc1)
76
+ rails (5.0.0)
77
+ actioncable (= 5.0.0)
78
+ actionmailer (= 5.0.0)
79
+ actionpack (= 5.0.0)
80
+ actionview (= 5.0.0)
81
+ activejob (= 5.0.0)
82
+ activemodel (= 5.0.0)
83
+ activerecord (= 5.0.0)
84
+ activesupport (= 5.0.0)
88
85
  bundler (>= 1.3.0, < 2.0)
89
- railties (= 5.0.0.rc1)
86
+ railties (= 5.0.0)
90
87
  sprockets-rails (>= 2.0.0)
91
- rails-deprecated_sanitizer (1.0.3)
92
- activesupport (>= 4.2.0.alpha)
93
- rails-dom-testing (1.0.7)
94
- activesupport (>= 4.2.0.beta, < 5.0)
95
- nokogiri (~> 1.6.0)
96
- rails-deprecated_sanitizer (>= 1.0.1)
97
- rails-html-sanitizer (1.0.3)
98
- loofah (~> 2.0)
99
- railties (5.0.0.rc1)
100
- actionpack (= 5.0.0.rc1)
101
- activesupport (= 5.0.0.rc1)
88
+ rails-dom-testing (2.0.3)
89
+ activesupport (>= 4.2.0)
90
+ nokogiri (>= 1.6)
91
+ rails-html-sanitizer (1.0.4)
92
+ loofah (~> 2.2, >= 2.2.2)
93
+ railties (5.0.0)
94
+ actionpack (= 5.0.0)
95
+ activesupport (= 5.0.0)
102
96
  method_source
103
97
  rake (>= 0.8.7)
104
98
  thor (>= 0.18.1, < 2.0)
105
- rake (11.2.2)
106
- sprockets (3.6.0)
99
+ rake (12.3.2)
100
+ sprockets (3.7.2)
107
101
  concurrent-ruby (~> 1.0)
108
102
  rack (> 1, < 3)
109
- sprockets-rails (3.0.4)
103
+ sprockets-rails (3.2.1)
110
104
  actionpack (>= 4.0)
111
105
  activesupport (>= 4.0)
112
106
  sprockets (>= 3.0.0)
113
- sqlite3 (1.3.11)
114
- thor (0.19.1)
115
- thread_safe (0.3.5)
116
- tzinfo (1.2.2)
107
+ sqlite3 (1.3.13)
108
+ thor (0.20.3)
109
+ thread_safe (0.3.6)
110
+ tzinfo (1.2.5)
117
111
  thread_safe (~> 0.1)
118
- websocket-driver (0.6.4)
112
+ websocket-driver (0.6.5)
119
113
  websocket-extensions (>= 0.1.0)
120
- websocket-extensions (0.1.2)
114
+ websocket-extensions (0.1.3)
121
115
 
122
116
  PLATFORMS
123
117
  ruby
124
118
 
125
119
  DEPENDENCIES
126
120
  appraisal
121
+ minitest (= 5.10.1)
127
122
  minitest-spec-rails!
128
- rails (= 5.0.0.rc1)
123
+ rails (= 5.0.0)
129
124
  rake
130
125
  sqlite3
131
126
 
132
127
  BUNDLED WITH
133
- 1.12.4
128
+ 1.17.2
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "5.1.0"
6
+ gem "minitest", "5.10.1"
7
+
8
+ gemspec :path => "../"
@@ -0,0 +1,128 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ minitest-spec-rails (5.5.0)
5
+ minitest (~> 5.0)
6
+ rails (>= 4.1)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actioncable (5.1.0)
12
+ actionpack (= 5.1.0)
13
+ nio4r (~> 2.0)
14
+ websocket-driver (~> 0.6.1)
15
+ actionmailer (5.1.0)
16
+ actionpack (= 5.1.0)
17
+ actionview (= 5.1.0)
18
+ activejob (= 5.1.0)
19
+ mail (~> 2.5, >= 2.5.4)
20
+ rails-dom-testing (~> 2.0)
21
+ actionpack (5.1.0)
22
+ actionview (= 5.1.0)
23
+ activesupport (= 5.1.0)
24
+ rack (~> 2.0)
25
+ rack-test (~> 0.6.3)
26
+ rails-dom-testing (~> 2.0)
27
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
28
+ actionview (5.1.0)
29
+ activesupport (= 5.1.0)
30
+ builder (~> 3.1)
31
+ erubi (~> 1.4)
32
+ rails-dom-testing (~> 2.0)
33
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
34
+ activejob (5.1.0)
35
+ activesupport (= 5.1.0)
36
+ globalid (>= 0.3.6)
37
+ activemodel (5.1.0)
38
+ activesupport (= 5.1.0)
39
+ activerecord (5.1.0)
40
+ activemodel (= 5.1.0)
41
+ activesupport (= 5.1.0)
42
+ arel (~> 8.0)
43
+ activesupport (5.1.0)
44
+ concurrent-ruby (~> 1.0, >= 1.0.2)
45
+ i18n (~> 0.7)
46
+ minitest (~> 5.1)
47
+ tzinfo (~> 1.1)
48
+ appraisal (2.2.0)
49
+ bundler
50
+ rake
51
+ thor (>= 0.14.0)
52
+ arel (8.0.0)
53
+ builder (3.2.3)
54
+ concurrent-ruby (1.1.4)
55
+ crass (1.0.4)
56
+ erubi (1.8.0)
57
+ globalid (0.4.2)
58
+ activesupport (>= 4.2.0)
59
+ i18n (0.9.5)
60
+ concurrent-ruby (~> 1.0)
61
+ loofah (2.2.3)
62
+ crass (~> 1.0.2)
63
+ nokogiri (>= 1.5.9)
64
+ mail (2.7.1)
65
+ mini_mime (>= 0.1.1)
66
+ method_source (0.9.2)
67
+ mini_mime (1.0.1)
68
+ mini_portile2 (2.4.0)
69
+ minitest (5.10.1)
70
+ nio4r (2.3.1)
71
+ nokogiri (1.9.1)
72
+ mini_portile2 (~> 2.4.0)
73
+ rack (2.0.6)
74
+ rack-test (0.6.3)
75
+ rack (>= 1.0)
76
+ rails (5.1.0)
77
+ actioncable (= 5.1.0)
78
+ actionmailer (= 5.1.0)
79
+ actionpack (= 5.1.0)
80
+ actionview (= 5.1.0)
81
+ activejob (= 5.1.0)
82
+ activemodel (= 5.1.0)
83
+ activerecord (= 5.1.0)
84
+ activesupport (= 5.1.0)
85
+ bundler (>= 1.3.0, < 2.0)
86
+ railties (= 5.1.0)
87
+ sprockets-rails (>= 2.0.0)
88
+ rails-dom-testing (2.0.3)
89
+ activesupport (>= 4.2.0)
90
+ nokogiri (>= 1.6)
91
+ rails-html-sanitizer (1.0.4)
92
+ loofah (~> 2.2, >= 2.2.2)
93
+ railties (5.1.0)
94
+ actionpack (= 5.1.0)
95
+ activesupport (= 5.1.0)
96
+ method_source
97
+ rake (>= 0.8.7)
98
+ thor (>= 0.18.1, < 2.0)
99
+ rake (12.3.2)
100
+ sprockets (3.7.2)
101
+ concurrent-ruby (~> 1.0)
102
+ rack (> 1, < 3)
103
+ sprockets-rails (3.2.1)
104
+ actionpack (>= 4.0)
105
+ activesupport (>= 4.0)
106
+ sprockets (>= 3.0.0)
107
+ sqlite3 (1.3.13)
108
+ thor (0.20.3)
109
+ thread_safe (0.3.6)
110
+ tzinfo (1.2.5)
111
+ thread_safe (~> 0.1)
112
+ websocket-driver (0.6.5)
113
+ websocket-extensions (>= 0.1.0)
114
+ websocket-extensions (0.1.3)
115
+
116
+ PLATFORMS
117
+ ruby
118
+
119
+ DEPENDENCIES
120
+ appraisal
121
+ minitest (= 5.10.1)
122
+ minitest-spec-rails!
123
+ rails (= 5.1.0)
124
+ rake
125
+ sqlite3
126
+
127
+ BUNDLED WITH
128
+ 1.17.2
@@ -1,13 +1,11 @@
1
1
  module MiniTestSpecRails
2
2
  module DSL
3
-
4
3
  def self.included(klass)
5
4
  klass.extend ClassMethods
6
5
  remove_method :test if method_defined?(:test)
7
6
  end
8
7
 
9
8
  module ClassMethods
10
-
11
9
  def describe(*args, &block)
12
10
  stack = Minitest::Spec.describe_stack
13
11
  stack.push self if stack.empty?
@@ -15,27 +13,25 @@ module MiniTestSpecRails
15
13
  stack.pop if stack.length == 1
16
14
  end
17
15
 
18
- def before(type = nil, &block)
19
- setup { self.instance_eval(&block) }
16
+ def before(_type = nil, &block)
17
+ setup { instance_eval(&block) }
20
18
  end
21
19
 
22
- def after(type = nil, &block)
23
- teardown { self.instance_eval(&block) }
20
+ def after(_type = nil, &block)
21
+ teardown { instance_eval(&block) }
24
22
  end
25
23
 
26
24
  def test(name, &block)
27
- it(name) { self.instance_eval(&block) }
25
+ instance_eval { it(name, &block) }
28
26
  end
29
27
 
30
28
  def described_class
31
29
  nil
32
30
  end
33
-
34
31
  end
35
32
 
36
33
  def described_class
37
34
  self.class.described_class
38
35
  end
39
-
40
36
  end
41
37
  end
@@ -1,24 +1,20 @@
1
1
  module MiniTestSpecRails
2
2
  module Init
3
3
  module ActionControllerBehavior
4
-
5
4
  extend ActiveSupport::Concern
6
5
 
7
6
  included do
8
7
  extend Descriptions
9
- register_spec_type(self) { |desc| Class === desc && desc < ActionController::Metal }
8
+ register_spec_type(self) { |desc| desc.is_a?(Class) && desc < ActionController::Metal }
10
9
  register_spec_type(/Controller( ?Test)?\z/, self)
11
- register_spec_type(self) { |desc| Class === desc && desc < self }
10
+ register_spec_type(self) { |desc| desc.is_a?(Class) && desc < self }
12
11
  end
13
-
14
- module Descriptions
15
12
 
13
+ module Descriptions
16
14
  def described_class
17
15
  determine_default_controller_class(name)
18
16
  end
19
-
20
17
  end
21
-
22
18
  end
23
19
  end
24
20
  end
@@ -1,14 +1,12 @@
1
1
  module MiniTestSpecRails
2
2
  module Init
3
3
  module ActionDispatchBehavior
4
-
5
4
  extend ActiveSupport::Concern
6
5
 
7
6
  included do
8
7
  register_spec_type(/(Acceptance|Integration) ?Test\z/, self)
9
- register_spec_type(self) { |desc| Class === desc && desc < self }
8
+ register_spec_type(self) { |desc| desc.is_a?(Class) && desc < self }
10
9
  end
11
-
12
10
  end
13
11
  end
14
12
  end
@@ -1,27 +1,22 @@
1
1
  module MiniTestSpecRails
2
2
  module Init
3
3
  module ActionMailerBehavior
4
-
5
4
  extend ActiveSupport::Concern
6
5
 
7
6
  included do
8
- register_spec_type(self) { |desc| Class === desc && desc < ActionMailer::Base }
7
+ register_spec_type(self) { |desc| desc.is_a?(Class) && desc < ActionMailer::Base }
9
8
  register_spec_type(/Mailer( ?Test)?\z/, self)
10
- register_spec_type(self) { |desc| Class === desc && desc < self }
9
+ register_spec_type(self) { |desc| desc.is_a?(Class) && desc < self }
11
10
  extend Descriptions
12
11
  end
13
12
 
14
13
  module Descriptions
15
-
16
14
  def described_class
17
15
  determine_default_mailer(name)
18
16
  end
19
-
20
17
  end
21
-
22
18
  end
23
19
  end
24
20
  end
25
21
 
26
22
  ActionMailer::TestCase.send :include, MiniTestSpecRails::Init::ActionMailerBehavior
27
-