minitest-rails 0.1.1 → 0.2
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.
- data/.travis.yml +19 -0
- data/CHANGELOG.rdoc +33 -1
- data/Manifest.txt +26 -7
- data/README.rdoc +22 -3
- data/Rakefile +4 -2
- data/gemfiles/3.0.gemfile +9 -0
- data/gemfiles/3.0.gemfile.lock +92 -0
- data/gemfiles/3.1.gemfile +9 -0
- data/gemfiles/3.1.gemfile.lock +103 -0
- data/gemfiles/3.2.gemfile +9 -0
- data/gemfiles/3.2.gemfile.lock +101 -0
- data/gemfiles/minitest_tu_shim.rb +4 -0
- data/lib/autotest/discover.rb +5 -0
- data/lib/autotest/fixtures.rb +7 -0
- data/lib/autotest/migrate.rb +5 -0
- data/lib/autotest/minitest_rails.rb +62 -0
- data/lib/generators/mini_test.rb +11 -3
- data/lib/minitest/rails/action_controller.rb +43 -1
- data/lib/minitest/rails/action_dispatch.rb +6 -6
- data/lib/minitest/rails/action_mailer.rb +3 -1
- data/lib/minitest/rails/action_view.rb +7 -5
- data/lib/minitest/rails/active_support.rb +5 -1
- data/lib/minitest/rails/tasks/minitest.rake +6 -0
- data/lib/minitest/rails.rb +2 -2
- data/lib/minitest-rails.rb +1 -1
- data/minitest-rails.gemspec +10 -7
- data/test/{test_controller_generator.rb → generators/test_controller_generator.rb} +34 -27
- data/test/{test_helper_generator.rb → generators/test_helper_generator.rb} +29 -24
- data/test/{test_install_generator.rb → generators/test_install_generator.rb} +20 -9
- data/test/{test_mailer_generator.rb → generators/test_mailer_generator.rb} +23 -14
- data/test/{test_model_generator.rb → generators/test_model_generator.rb} +27 -25
- data/test/{test_scaffold_generator.rb → generators/test_scaffold_generator.rb} +23 -14
- data/test/rails/action_controller/test_controller_lookup.rb +49 -0
- data/test/rails/action_controller/test_controllers.rb +223 -0
- data/test/rails/action_controller/test_spec_type.rb +41 -0
- data/test/rails/test_action_dispatch_spec_type.rb +48 -0
- data/test/rails/test_action_mailer_spec_type.rb +42 -0
- data/test/rails/test_action_view_spec_type.rb +42 -0
- data/test/rails/test_active_support_spec_type.rb +27 -0
- metadata +60 -18
- /data/test/{test_minitest.rb → test_sanity.rb} +0 -0
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
require "minitest/autorun"
|
|
2
|
+
require "rails"
|
|
3
|
+
|
|
4
|
+
require "minitest/rails/action_controller"
|
|
5
|
+
require "action_controller"
|
|
6
|
+
|
|
7
|
+
# require "active_record/railtie"
|
|
8
|
+
require "action_controller/railtie"
|
|
9
|
+
# require "action_mailer/railtie"
|
|
10
|
+
# require "active_resource/railtie"
|
|
11
|
+
# require "sprockets/railtie"
|
|
12
|
+
# require "rails/test_unit/railtie"
|
|
13
|
+
|
|
14
|
+
class TestApp < Rails::Application
|
|
15
|
+
end
|
|
16
|
+
Rails.application = TestApp
|
|
17
|
+
|
|
18
|
+
class ApplicationController < ActionController::Base; end
|
|
19
|
+
class ModelsController < ApplicationController; end
|
|
20
|
+
module Admin
|
|
21
|
+
class WidgetsController < ApplicationController; end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# ApplicationController
|
|
25
|
+
describe ApplicationController do
|
|
26
|
+
describe "nested" do
|
|
27
|
+
describe "even deeper" do
|
|
28
|
+
it "exists" do
|
|
29
|
+
assert_kind_of ApplicationController, @controller
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
describe ApplicationController, :index do
|
|
36
|
+
describe "nested" do
|
|
37
|
+
describe "even deeper" do
|
|
38
|
+
it "exists" do
|
|
39
|
+
assert_kind_of ApplicationController, @controller
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
describe ApplicationController, "unauthenticated user" do
|
|
46
|
+
describe "nested" do
|
|
47
|
+
describe "even deeper" do
|
|
48
|
+
it "exists" do
|
|
49
|
+
assert_kind_of ApplicationController, @controller
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
describe "ApplicationControllerTest" do
|
|
56
|
+
describe "nested" do
|
|
57
|
+
describe "even deeper" do
|
|
58
|
+
it "exists" do
|
|
59
|
+
assert_kind_of ApplicationController, @controller
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
describe "ApplicationControllerTest", :index do
|
|
66
|
+
describe "nested" do
|
|
67
|
+
describe "even deeper" do
|
|
68
|
+
it "exists" do
|
|
69
|
+
assert_kind_of ApplicationController, @controller
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
describe "ApplicationControllerTest", "unauthenticated user" do
|
|
76
|
+
describe "nested" do
|
|
77
|
+
describe "even deeper" do
|
|
78
|
+
it "exists" do
|
|
79
|
+
assert_kind_of ApplicationController, @controller
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# ModelsController
|
|
86
|
+
describe ModelsController do
|
|
87
|
+
describe "nested" do
|
|
88
|
+
describe "even deeper" do
|
|
89
|
+
it "exists" do
|
|
90
|
+
assert_kind_of ModelsController, @controller
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
describe ModelsController, :index do
|
|
97
|
+
describe "nested" do
|
|
98
|
+
describe "even deeper" do
|
|
99
|
+
it "exists" do
|
|
100
|
+
assert_kind_of ModelsController, @controller
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
describe ModelsController, "unauthenticated user" do
|
|
107
|
+
describe "nested" do
|
|
108
|
+
describe "even deeper" do
|
|
109
|
+
it "exists" do
|
|
110
|
+
assert_kind_of ModelsController, @controller
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
describe "ModelsControllerTest" do
|
|
117
|
+
describe "nested" do
|
|
118
|
+
describe "even deeper" do
|
|
119
|
+
it "exists" do
|
|
120
|
+
assert_kind_of ModelsController, @controller
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
describe "ModelsControllerTest", :index do
|
|
127
|
+
describe "nested" do
|
|
128
|
+
describe "even deeper" do
|
|
129
|
+
it "exists" do
|
|
130
|
+
assert_kind_of ModelsController, @controller
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
describe "ModelsControllerTest", "unauthenticated user" do
|
|
137
|
+
describe "nested" do
|
|
138
|
+
describe "even deeper" do
|
|
139
|
+
it "exists" do
|
|
140
|
+
assert_kind_of ModelsController, @controller
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Nested Admin::WidgetsControllerTest
|
|
147
|
+
module Admin
|
|
148
|
+
class WidgetsControllerTest < MiniTest::Rails::ActionController::TestCase
|
|
149
|
+
test "exists" do
|
|
150
|
+
assert_kind_of Admin::WidgetsController, @controller
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
describe WidgetsController do
|
|
155
|
+
describe "index" do
|
|
156
|
+
it "respond successful" do
|
|
157
|
+
assert_kind_of Admin::WidgetsController, @controller
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
describe WidgetsController, "unauthenticated users" do
|
|
163
|
+
describe "index" do
|
|
164
|
+
it "respond successful" do
|
|
165
|
+
assert_kind_of Admin::WidgetsController, @controller
|
|
166
|
+
end
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
class Admin::WidgetsControllerTest < MiniTest::Rails::ActionController::TestCase
|
|
172
|
+
test "exists here too" do
|
|
173
|
+
assert_kind_of Admin::WidgetsController, @controller
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
describe Admin::WidgetsController do
|
|
178
|
+
describe "index" do
|
|
179
|
+
it "respond successful" do
|
|
180
|
+
assert_kind_of Admin::WidgetsController, @controller
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
describe Admin::WidgetsController, "unauthenticated users" do
|
|
186
|
+
describe "index" do
|
|
187
|
+
it "respond successful" do
|
|
188
|
+
assert_kind_of Admin::WidgetsController, @controller
|
|
189
|
+
end
|
|
190
|
+
end
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
describe "Admin::WidgetsController" do
|
|
194
|
+
describe "index" do
|
|
195
|
+
it "respond successful" do
|
|
196
|
+
assert_kind_of Admin::WidgetsController, @controller
|
|
197
|
+
end
|
|
198
|
+
end
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
describe "Admin::WidgetsControllerTest" do
|
|
202
|
+
describe "index" do
|
|
203
|
+
it "respond successful" do
|
|
204
|
+
assert_kind_of Admin::WidgetsController, @controller
|
|
205
|
+
end
|
|
206
|
+
end
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
describe "Admin::WidgetsController", "unauthenticated users" do
|
|
210
|
+
describe "index" do
|
|
211
|
+
it "respond successful" do
|
|
212
|
+
assert_kind_of Admin::WidgetsController, @controller
|
|
213
|
+
end
|
|
214
|
+
end
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
describe "Admin::WidgetsControllerTest", "unauthenticated users" do
|
|
218
|
+
describe "index" do
|
|
219
|
+
it "respond successful" do
|
|
220
|
+
assert_kind_of Admin::WidgetsController, @controller
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
require "minitest/autorun"
|
|
2
|
+
require "rails"
|
|
3
|
+
|
|
4
|
+
require "minitest/rails/action_controller"
|
|
5
|
+
require "action_controller"
|
|
6
|
+
|
|
7
|
+
class ApplicationController < ActionController::Base; end
|
|
8
|
+
class ModelsController < ApplicationController; end
|
|
9
|
+
|
|
10
|
+
class TestApplicationControllerSpecType < MiniTest::Unit::TestCase
|
|
11
|
+
def assert_controller actual
|
|
12
|
+
assert_equal MiniTest::Rails::ActionController::TestCase, actual
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def refute_controller actual
|
|
16
|
+
refute_equal MiniTest::Rails::ActionController::TestCase, actual
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def test_spec_type_resolves_for_class_constants
|
|
20
|
+
assert_controller MiniTest::Spec.spec_type(ApplicationController)
|
|
21
|
+
assert_controller MiniTest::Spec.spec_type(ModelsController)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def test_spec_type_resolves_for_matching_strings
|
|
25
|
+
assert_controller MiniTest::Spec.spec_type("WidgetController")
|
|
26
|
+
assert_controller MiniTest::Spec.spec_type("WidgetControllerTest")
|
|
27
|
+
assert_controller MiniTest::Spec.spec_type("Widget Controller Test")
|
|
28
|
+
# And is not case sensitive
|
|
29
|
+
assert_controller MiniTest::Spec.spec_type("widgetcontroller")
|
|
30
|
+
assert_controller MiniTest::Spec.spec_type("widgetcontrollertest")
|
|
31
|
+
assert_controller MiniTest::Spec.spec_type("widget controller test")
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def test_spec_type_wont_match_non_space_characters
|
|
35
|
+
refute_controller MiniTest::Spec.spec_type("Widget Controller\tTest")
|
|
36
|
+
refute_controller MiniTest::Spec.spec_type("Widget Controller\rTest")
|
|
37
|
+
refute_controller MiniTest::Spec.spec_type("Widget Controller\nTest")
|
|
38
|
+
refute_controller MiniTest::Spec.spec_type("Widget Controller\fTest")
|
|
39
|
+
refute_controller MiniTest::Spec.spec_type("Widget ControllerXTest")
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
require "minitest/autorun"
|
|
2
|
+
require "rails"
|
|
3
|
+
|
|
4
|
+
require "minitest/rails/action_dispatch"
|
|
5
|
+
|
|
6
|
+
class TestActionDispatchSpecType < MiniTest::Unit::TestCase
|
|
7
|
+
def assert_dispatch actual
|
|
8
|
+
assert_equal MiniTest::Rails::ActionDispatch::IntegrationTest, actual
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def refute_dispatch actual
|
|
12
|
+
refute_equal MiniTest::Rails::ActionDispatch::IntegrationTest, actual
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def test_spec_type_resolves_for_matching_acceptance_strings
|
|
16
|
+
assert_dispatch MiniTest::Spec.spec_type("WidgetAcceptanceTest")
|
|
17
|
+
assert_dispatch MiniTest::Spec.spec_type("Widget Acceptance Test")
|
|
18
|
+
# And is not case sensitive
|
|
19
|
+
assert_dispatch MiniTest::Spec.spec_type("widgetacceptancetest")
|
|
20
|
+
assert_dispatch MiniTest::Spec.spec_type("widget acceptance test")
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def test_spec_type_wont_match_non_space_characters_acceptance
|
|
24
|
+
refute_dispatch MiniTest::Spec.spec_type("Widget Acceptance\tTest")
|
|
25
|
+
refute_dispatch MiniTest::Spec.spec_type("Widget Acceptance\rTest")
|
|
26
|
+
# TODO: Update regex so that new lines don't match.
|
|
27
|
+
refute_dispatch MiniTest::Spec.spec_type("Widget Acceptance\nTest")
|
|
28
|
+
refute_dispatch MiniTest::Spec.spec_type("Widget Acceptance\fTest")
|
|
29
|
+
refute_dispatch MiniTest::Spec.spec_type("Widget AcceptanceXTest")
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def test_spec_type_resolves_for_matching_integration_strings
|
|
33
|
+
assert_dispatch MiniTest::Spec.spec_type("WidgetIntegrationTest")
|
|
34
|
+
assert_dispatch MiniTest::Spec.spec_type("Widget Integration Test")
|
|
35
|
+
# And is not case sensitive
|
|
36
|
+
assert_dispatch MiniTest::Spec.spec_type("widgetintegrationtest")
|
|
37
|
+
assert_dispatch MiniTest::Spec.spec_type("widget integration test")
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def test_spec_type_wont_match_non_space_characters_integration
|
|
41
|
+
refute_equal MiniTest::Spec.spec_type("Widget Integration\tTest"), MiniTest::Rails::ActionDispatch::IntegrationTest
|
|
42
|
+
refute_equal MiniTest::Spec.spec_type("Widget Integration\rTest"), MiniTest::Rails::ActionDispatch::IntegrationTest
|
|
43
|
+
# TODO: Update regex so that new lines don't match.
|
|
44
|
+
refute_equal MiniTest::Spec.spec_type("Widget Integration\nTest"), MiniTest::Rails::ActionDispatch::IntegrationTest
|
|
45
|
+
refute_equal MiniTest::Spec.spec_type("Widget Integration\fTest"), MiniTest::Rails::ActionDispatch::IntegrationTest
|
|
46
|
+
refute_equal MiniTest::Spec.spec_type("Widget IntegrationXTest"), MiniTest::Rails::ActionDispatch::IntegrationTest
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
require "minitest/autorun"
|
|
2
|
+
require "rails"
|
|
3
|
+
|
|
4
|
+
require "action_mailer/test_helper"
|
|
5
|
+
require "minitest/rails/action_mailer"
|
|
6
|
+
require "action_mailer"
|
|
7
|
+
|
|
8
|
+
class NotificationMailer < ActionMailer::Base; end
|
|
9
|
+
class Notifications < ActionMailer::Base; end
|
|
10
|
+
|
|
11
|
+
class TestActionMailerSpecType < MiniTest::Unit::TestCase
|
|
12
|
+
def assert_mailer actual
|
|
13
|
+
assert_equal MiniTest::Rails::ActionMailer::TestCase, actual
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def refute_mailer actual
|
|
17
|
+
refute_equal MiniTest::Rails::ActionMailer::TestCase, actual
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def test_spec_type_resolves_for_class_constants
|
|
21
|
+
assert_mailer MiniTest::Spec.spec_type(NotificationMailer)
|
|
22
|
+
assert_mailer MiniTest::Spec.spec_type(Notifications)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def test_spec_type_resolves_for_matching_strings
|
|
26
|
+
assert_mailer MiniTest::Spec.spec_type("WidgetMailer")
|
|
27
|
+
assert_mailer MiniTest::Spec.spec_type("WidgetMailerTest")
|
|
28
|
+
assert_mailer MiniTest::Spec.spec_type("Widget Mailer Test")
|
|
29
|
+
# And is not case sensitive
|
|
30
|
+
assert_mailer MiniTest::Spec.spec_type("widgetmailer")
|
|
31
|
+
assert_mailer MiniTest::Spec.spec_type("widgetmailertest")
|
|
32
|
+
assert_mailer MiniTest::Spec.spec_type("widget mailer test")
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def test_spec_type_wont_match_non_space_characters
|
|
36
|
+
refute_mailer MiniTest::Spec.spec_type("Widget Mailer\tTest")
|
|
37
|
+
refute_mailer MiniTest::Spec.spec_type("Widget Mailer\rTest")
|
|
38
|
+
refute_mailer MiniTest::Spec.spec_type("Widget Mailer\nTest")
|
|
39
|
+
refute_mailer MiniTest::Spec.spec_type("Widget Mailer\fTest")
|
|
40
|
+
refute_mailer MiniTest::Spec.spec_type("Widget MailerXTest")
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
require "minitest/autorun"
|
|
2
|
+
require "rails"
|
|
3
|
+
|
|
4
|
+
require "minitest/rails/action_view"
|
|
5
|
+
|
|
6
|
+
class TestActionViewSpecType < MiniTest::Unit::TestCase
|
|
7
|
+
def assert_view actual
|
|
8
|
+
assert_equal MiniTest::Rails::ActionView::TestCase, actual
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def refute_view actual
|
|
12
|
+
refute_equal MiniTest::Rails::ActionView::TestCase, actual
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def test_spec_type_resolves_for_matching_helper_strings
|
|
16
|
+
assert_view MiniTest::Spec.spec_type("WidgetHelper")
|
|
17
|
+
assert_view MiniTest::Spec.spec_type("WidgetHelperTest")
|
|
18
|
+
assert_view MiniTest::Spec.spec_type("Widget Helper Test")
|
|
19
|
+
# And is not case sensitive
|
|
20
|
+
assert_view MiniTest::Spec.spec_type("widgethelper")
|
|
21
|
+
assert_view MiniTest::Spec.spec_type("widgethelpertest")
|
|
22
|
+
assert_view MiniTest::Spec.spec_type("widget helper test")
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def test_spec_type_resolves_for_matching_view_strings
|
|
26
|
+
assert_view MiniTest::Spec.spec_type("WidgetView")
|
|
27
|
+
assert_view MiniTest::Spec.spec_type("WidgetViewTest")
|
|
28
|
+
assert_view MiniTest::Spec.spec_type("Widget View Test")
|
|
29
|
+
# And is not case sensitive
|
|
30
|
+
assert_view MiniTest::Spec.spec_type("widgetview")
|
|
31
|
+
assert_view MiniTest::Spec.spec_type("widgetviewtest")
|
|
32
|
+
assert_view MiniTest::Spec.spec_type("widget view test")
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def test_spec_type_wont_match_non_space_characters
|
|
36
|
+
refute_view MiniTest::Spec.spec_type("Widget Helper\tTest")
|
|
37
|
+
refute_view MiniTest::Spec.spec_type("Widget Helper\rTest")
|
|
38
|
+
refute_view MiniTest::Spec.spec_type("Widget Helper\nTest")
|
|
39
|
+
refute_view MiniTest::Spec.spec_type("Widget Helper\fTest")
|
|
40
|
+
refute_view MiniTest::Spec.spec_type("Widget HelperXTest")
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
require "minitest/autorun"
|
|
2
|
+
require "rails"
|
|
3
|
+
|
|
4
|
+
require "active_record"
|
|
5
|
+
load "minitest/rails/active_support.rb" # Force reload
|
|
6
|
+
# Not sure why we need to reload, but we do...
|
|
7
|
+
|
|
8
|
+
class SomeRandomModel < ActiveRecord::Base; end
|
|
9
|
+
|
|
10
|
+
class TestActiveSupportSpecType < MiniTest::Unit::TestCase
|
|
11
|
+
|
|
12
|
+
def assert_support actual
|
|
13
|
+
assert_equal MiniTest::Rails::ActiveSupport::TestCase, actual
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def assert_spec actual
|
|
17
|
+
assert_equal MiniTest::Spec, actual
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def test_spec_type_resolves_for_actitive_record_constants
|
|
21
|
+
assert_support MiniTest::Spec.spec_type(SomeRandomModel)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def test_spec_type_doesnt_resolve_random_strings
|
|
25
|
+
assert_spec MiniTest::Spec.spec_type("Unmatched String")
|
|
26
|
+
end
|
|
27
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: minitest-rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: '0.2'
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2012-
|
|
12
|
+
date: 2012-09-19 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: minitest
|
|
@@ -18,7 +18,7 @@ dependencies:
|
|
|
18
18
|
requirements:
|
|
19
19
|
- - ~>
|
|
20
20
|
- !ruby/object:Gem::Version
|
|
21
|
-
version: '3.
|
|
21
|
+
version: '3.4'
|
|
22
22
|
type: :runtime
|
|
23
23
|
prerelease: false
|
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -26,7 +26,7 @@ dependencies:
|
|
|
26
26
|
requirements:
|
|
27
27
|
- - ~>
|
|
28
28
|
- !ruby/object:Gem::Version
|
|
29
|
-
version: '3.
|
|
29
|
+
version: '3.4'
|
|
30
30
|
- !ruby/object:Gem::Dependency
|
|
31
31
|
name: rails
|
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -59,6 +59,22 @@ dependencies:
|
|
|
59
59
|
- - ~>
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
61
|
version: '3.10'
|
|
62
|
+
- !ruby/object:Gem::Dependency
|
|
63
|
+
name: fakefs
|
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
|
65
|
+
none: false
|
|
66
|
+
requirements:
|
|
67
|
+
- - ~>
|
|
68
|
+
- !ruby/object:Gem::Version
|
|
69
|
+
version: '0.4'
|
|
70
|
+
type: :development
|
|
71
|
+
prerelease: false
|
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
73
|
+
none: false
|
|
74
|
+
requirements:
|
|
75
|
+
- - ~>
|
|
76
|
+
- !ruby/object:Gem::Version
|
|
77
|
+
version: '0.4'
|
|
62
78
|
- !ruby/object:Gem::Dependency
|
|
63
79
|
name: hoe
|
|
64
80
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -87,11 +103,23 @@ extra_rdoc_files:
|
|
|
87
103
|
files:
|
|
88
104
|
- .autotest
|
|
89
105
|
- .gemtest
|
|
106
|
+
- .travis.yml
|
|
90
107
|
- CHANGELOG.rdoc
|
|
91
108
|
- LICENSE
|
|
92
109
|
- Manifest.txt
|
|
93
110
|
- README.rdoc
|
|
94
111
|
- Rakefile
|
|
112
|
+
- gemfiles/3.0.gemfile
|
|
113
|
+
- gemfiles/3.0.gemfile.lock
|
|
114
|
+
- gemfiles/3.1.gemfile
|
|
115
|
+
- gemfiles/3.1.gemfile.lock
|
|
116
|
+
- gemfiles/3.2.gemfile
|
|
117
|
+
- gemfiles/3.2.gemfile.lock
|
|
118
|
+
- gemfiles/minitest_tu_shim.rb
|
|
119
|
+
- lib/autotest/discover.rb
|
|
120
|
+
- lib/autotest/fixtures.rb
|
|
121
|
+
- lib/autotest/migrate.rb
|
|
122
|
+
- lib/autotest/minitest_rails.rb
|
|
95
123
|
- lib/generators/mini_test.rb
|
|
96
124
|
- lib/generators/mini_test/controller/controller_generator.rb
|
|
97
125
|
- lib/generators/mini_test/controller/templates/controller_spec.rb
|
|
@@ -126,13 +154,20 @@ files:
|
|
|
126
154
|
- lib/minitest/rails/tasks/minitest.rake
|
|
127
155
|
- lib/minitest/rails/tasks/sub_test_task.rb
|
|
128
156
|
- minitest-rails.gemspec
|
|
129
|
-
- test/test_controller_generator.rb
|
|
130
|
-
- test/test_helper_generator.rb
|
|
131
|
-
- test/test_install_generator.rb
|
|
132
|
-
- test/test_mailer_generator.rb
|
|
133
|
-
- test/
|
|
134
|
-
- test/
|
|
135
|
-
- test/
|
|
157
|
+
- test/generators/test_controller_generator.rb
|
|
158
|
+
- test/generators/test_helper_generator.rb
|
|
159
|
+
- test/generators/test_install_generator.rb
|
|
160
|
+
- test/generators/test_mailer_generator.rb
|
|
161
|
+
- test/generators/test_model_generator.rb
|
|
162
|
+
- test/generators/test_scaffold_generator.rb
|
|
163
|
+
- test/rails/action_controller/test_controller_lookup.rb
|
|
164
|
+
- test/rails/action_controller/test_controllers.rb
|
|
165
|
+
- test/rails/action_controller/test_spec_type.rb
|
|
166
|
+
- test/rails/test_action_dispatch_spec_type.rb
|
|
167
|
+
- test/rails/test_action_mailer_spec_type.rb
|
|
168
|
+
- test/rails/test_action_view_spec_type.rb
|
|
169
|
+
- test/rails/test_active_support_spec_type.rb
|
|
170
|
+
- test/test_sanity.rb
|
|
136
171
|
homepage: http://blowmage.com/minitest-rails
|
|
137
172
|
licenses: []
|
|
138
173
|
post_install_message:
|
|
@@ -160,10 +195,17 @@ signing_key:
|
|
|
160
195
|
specification_version: 3
|
|
161
196
|
summary: MiniTest integration for Rails 3.x
|
|
162
197
|
test_files:
|
|
163
|
-
- test/test_controller_generator.rb
|
|
164
|
-
- test/test_helper_generator.rb
|
|
165
|
-
- test/test_install_generator.rb
|
|
166
|
-
- test/test_mailer_generator.rb
|
|
167
|
-
- test/
|
|
168
|
-
- test/
|
|
169
|
-
- test/
|
|
198
|
+
- test/generators/test_controller_generator.rb
|
|
199
|
+
- test/generators/test_helper_generator.rb
|
|
200
|
+
- test/generators/test_install_generator.rb
|
|
201
|
+
- test/generators/test_mailer_generator.rb
|
|
202
|
+
- test/generators/test_model_generator.rb
|
|
203
|
+
- test/generators/test_scaffold_generator.rb
|
|
204
|
+
- test/rails/action_controller/test_controller_lookup.rb
|
|
205
|
+
- test/rails/action_controller/test_controllers.rb
|
|
206
|
+
- test/rails/action_controller/test_spec_type.rb
|
|
207
|
+
- test/rails/test_action_dispatch_spec_type.rb
|
|
208
|
+
- test/rails/test_action_mailer_spec_type.rb
|
|
209
|
+
- test/rails/test_action_view_spec_type.rb
|
|
210
|
+
- test/rails/test_active_support_spec_type.rb
|
|
211
|
+
- test/test_sanity.rb
|
|
File without changes
|