minitest-spec-rails 5.4.0 → 6.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/ci.yml +35 -0
- data/.rubocop.yml +26 -0
- data/Appraisals +10 -6
- data/CHANGELOG.md +25 -1
- data/Gemfile +0 -1
- data/README.md +23 -35
- data/Rakefile +6 -6
- data/gemfiles/{rails42.gemfile → rails_v5.1.x.gemfile} +3 -2
- data/gemfiles/rails_v5.1.x.gemfile.lock +128 -0
- data/gemfiles/{rails50.gemfile → rails_v5.2.x.gemfile} +3 -2
- data/gemfiles/rails_v5.2.x.gemfile.lock +136 -0
- data/gemfiles/{rails41.gemfile → rails_v6.0.x.gemfile} +3 -2
- data/gemfiles/rails_v6.0.x.gemfile.lock +152 -0
- data/lib/minitest-spec-rails/dsl.rb +5 -9
- data/lib/minitest-spec-rails/init/action_controller.rb +3 -7
- data/lib/minitest-spec-rails/init/action_dispatch.rb +1 -3
- data/lib/minitest-spec-rails/init/action_mailer.rb +2 -7
- data/lib/minitest-spec-rails/init/action_view.rb +1 -5
- data/lib/minitest-spec-rails/init/active_job.rb +3 -8
- data/lib/minitest-spec-rails/init/active_support.rb +8 -10
- data/lib/minitest-spec-rails/init/mini_shoulda.rb +2 -6
- data/lib/minitest-spec-rails/parallelize.rb +30 -0
- data/lib/minitest-spec-rails/railtie.rb +24 -21
- data/lib/minitest-spec-rails/version.rb +1 -1
- data/minitest-spec-rails.gemspec +7 -7
- data/test/cases/action_controller_test.rb +7 -10
- data/test/cases/action_dispatch_test.rb +10 -13
- data/test/cases/action_mailer_test.rb +7 -10
- data/test/cases/action_view_test.rb +13 -16
- data/test/cases/active_job_test.rb +38 -36
- data/test/cases/active_support_test.rb +22 -12
- data/test/cases/mini_shoulda_test.rb +0 -4
- data/test/dummy_app/app/assets/config/manifest.js +1 -0
- data/test/dummy_app/app/controllers/application_controller.rb +1 -3
- data/test/dummy_app/app/controllers/users_controller.rb +1 -3
- data/test/dummy_app/app/helpers/application_helper.rb +0 -1
- data/test/dummy_app/app/helpers/foos_helper.rb +3 -1
- data/test/dummy_app/app/helpers/users_helper.rb +1 -3
- data/test/dummy_app/app/mailers/user_mailer.rb +2 -4
- data/test/dummy_app/app/models/post.rb +0 -3
- data/test/dummy_app/app/models/user.rb +0 -3
- data/test/dummy_app/config/routes.rb +1 -1
- data/test/dummy_app/init.rb +13 -6
- data/test/dummy_tests/application_controller_test.rb +3 -9
- data/test/dummy_tests/foos_helper_test.rb +0 -3
- data/test/dummy_tests/integration_test.rb +2 -8
- data/test/dummy_tests/special_users_controller_test.rb +0 -2
- data/test/dummy_tests/user_mailer_test.rb +4 -10
- data/test/dummy_tests/user_test.rb +2 -8
- data/test/dummy_tests/users_controller_test.rb +1 -3
- data/test/dummy_tests/users_helper_test.rb +2 -8
- data/test/support/shared_test_case_behavior.rb +4 -7
- data/test/test_helper.rb +0 -3
- data/test/test_helper_dummy.rb +5 -6
- metadata +20 -16
- data/.travis.yml +0 -22
- data/gemfiles/rails41.gemfile.lock +0 -96
- data/gemfiles/rails42.gemfile.lock +0 -123
- data/gemfiles/rails50.gemfile.lock +0 -133
data/minitest-spec-rails.gemspec
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require "minitest-spec-rails/version"
|
1
|
+
$LOAD_PATH.push File.expand_path('lib', __dir__)
|
2
|
+
require 'minitest-spec-rails/version'
|
4
3
|
|
5
4
|
Gem::Specification.new do |gem|
|
6
5
|
gem.name = 'minitest-spec-rails'
|
@@ -10,14 +9,15 @@ Gem::Specification.new do |gem|
|
|
10
9
|
gem.email = ['ken@metaskills.net']
|
11
10
|
gem.homepage = 'http://github.com/metaskills/minitest-spec-rails'
|
12
11
|
gem.summary = 'Make Rails Use MiniTest::Spec!'
|
13
|
-
gem.description = 'The minitest-spec-rails gem makes it easy to use the
|
12
|
+
gem.description = 'The minitest-spec-rails gem makes it easy to use the \
|
13
|
+
MiniTest::Spec DSL within your existing Rails test suite.'
|
14
14
|
gem.license = 'MIT'
|
15
15
|
gem.files = `git ls-files`.split("\n")
|
16
16
|
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
17
|
-
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
|
+
gem.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
18
18
|
gem.require_paths = ['lib']
|
19
|
-
gem.add_runtime_dependency 'minitest', '
|
20
|
-
gem.add_runtime_dependency '
|
19
|
+
gem.add_runtime_dependency 'minitest', '>= 5.0'
|
20
|
+
gem.add_runtime_dependency 'railties', '>= 4.1'
|
21
21
|
gem.add_development_dependency 'appraisal'
|
22
22
|
gem.add_development_dependency 'rake'
|
23
23
|
gem.add_development_dependency 'sqlite3'
|
@@ -3,20 +3,19 @@ require 'test_helper'
|
|
3
3
|
class ModelsController < ApplicationController; end
|
4
4
|
|
5
5
|
class ActionControllerTest < MiniTestSpecRails::TestCase
|
6
|
-
|
7
6
|
it 'matches spec type for class constants' do
|
8
7
|
assert_controller MiniTest::Spec.spec_type(ApplicationController)
|
9
8
|
assert_controller MiniTest::Spec.spec_type(ModelsController)
|
10
9
|
end
|
11
10
|
|
12
11
|
it 'matches spec type for strings' do
|
13
|
-
assert_controller MiniTest::Spec.spec_type(
|
14
|
-
assert_controller MiniTest::Spec.spec_type(
|
15
|
-
assert_controller MiniTest::Spec.spec_type(
|
12
|
+
assert_controller MiniTest::Spec.spec_type('WidgetController')
|
13
|
+
assert_controller MiniTest::Spec.spec_type('WidgetControllerTest')
|
14
|
+
assert_controller MiniTest::Spec.spec_type('Widget Controller Test')
|
16
15
|
# And is case sensitive
|
17
|
-
refute_controller MiniTest::Spec.spec_type(
|
18
|
-
refute_controller MiniTest::Spec.spec_type(
|
19
|
-
refute_controller MiniTest::Spec.spec_type(
|
16
|
+
refute_controller MiniTest::Spec.spec_type('widgetcontroller')
|
17
|
+
refute_controller MiniTest::Spec.spec_type('widgetcontrollertest')
|
18
|
+
refute_controller MiniTest::Spec.spec_type('widget controller test')
|
20
19
|
end
|
21
20
|
|
22
21
|
it 'wont match spec type for non space characters' do
|
@@ -24,10 +23,9 @@ class ActionControllerTest < MiniTestSpecRails::TestCase
|
|
24
23
|
refute_controller MiniTest::Spec.spec_type("Widget Controller\rTest")
|
25
24
|
refute_controller MiniTest::Spec.spec_type("Widget Controller\nTest")
|
26
25
|
refute_controller MiniTest::Spec.spec_type("Widget Controller\fTest")
|
27
|
-
refute_controller MiniTest::Spec.spec_type(
|
26
|
+
refute_controller MiniTest::Spec.spec_type('Widget ControllerXTest')
|
28
27
|
end
|
29
28
|
|
30
|
-
|
31
29
|
private
|
32
30
|
|
33
31
|
def assert_controller(actual)
|
@@ -37,5 +35,4 @@ class ActionControllerTest < MiniTestSpecRails::TestCase
|
|
37
35
|
def refute_controller(actual)
|
38
36
|
refute_equal ActionController::TestCase, actual
|
39
37
|
end
|
40
|
-
|
41
38
|
end
|
@@ -3,13 +3,12 @@ require 'test_helper'
|
|
3
3
|
class ModelsController < ApplicationController; end
|
4
4
|
|
5
5
|
class ActionControllerTest < MiniTestSpecRails::TestCase
|
6
|
-
|
7
6
|
it 'resolves spec type for matching acceptance strings' do
|
8
|
-
assert_dispatch MiniTest::Spec.spec_type(
|
9
|
-
assert_dispatch MiniTest::Spec.spec_type(
|
7
|
+
assert_dispatch MiniTest::Spec.spec_type('WidgetAcceptanceTest')
|
8
|
+
assert_dispatch MiniTest::Spec.spec_type('Widget Acceptance Test')
|
10
9
|
# And is case sensitive
|
11
|
-
refute_dispatch MiniTest::Spec.spec_type(
|
12
|
-
refute_dispatch MiniTest::Spec.spec_type(
|
10
|
+
refute_dispatch MiniTest::Spec.spec_type('widgetacceptancetest')
|
11
|
+
refute_dispatch MiniTest::Spec.spec_type('widget acceptance test')
|
13
12
|
end
|
14
13
|
|
15
14
|
it 'wont match spec type for space characters in acceptance strings' do
|
@@ -17,15 +16,15 @@ class ActionControllerTest < MiniTestSpecRails::TestCase
|
|
17
16
|
refute_dispatch MiniTest::Spec.spec_type("Widget Acceptance\rTest")
|
18
17
|
refute_dispatch MiniTest::Spec.spec_type("Widget Acceptance\nTest")
|
19
18
|
refute_dispatch MiniTest::Spec.spec_type("Widget Acceptance\fTest")
|
20
|
-
refute_dispatch MiniTest::Spec.spec_type(
|
19
|
+
refute_dispatch MiniTest::Spec.spec_type('Widget AcceptanceXTest')
|
21
20
|
end
|
22
21
|
|
23
22
|
it 'resolves spec type for matching integration strings' do
|
24
|
-
assert_dispatch MiniTest::Spec.spec_type(
|
25
|
-
assert_dispatch MiniTest::Spec.spec_type(
|
23
|
+
assert_dispatch MiniTest::Spec.spec_type('WidgetIntegrationTest')
|
24
|
+
assert_dispatch MiniTest::Spec.spec_type('Widget Integration Test')
|
26
25
|
# And is case sensitive
|
27
|
-
refute_dispatch MiniTest::Spec.spec_type(
|
28
|
-
refute_dispatch MiniTest::Spec.spec_type(
|
26
|
+
refute_dispatch MiniTest::Spec.spec_type('widgetintegrationtest')
|
27
|
+
refute_dispatch MiniTest::Spec.spec_type('widget integration test')
|
29
28
|
end
|
30
29
|
|
31
30
|
it 'wont match spec type for space characters in integration strings' do
|
@@ -33,10 +32,9 @@ class ActionControllerTest < MiniTestSpecRails::TestCase
|
|
33
32
|
refute_dispatch MiniTest::Spec.spec_type("Widget Integration\rTest")
|
34
33
|
refute_dispatch MiniTest::Spec.spec_type("Widget Integration\nTest")
|
35
34
|
refute_dispatch MiniTest::Spec.spec_type("Widget Integration\fTest")
|
36
|
-
refute_dispatch MiniTest::Spec.spec_type(
|
35
|
+
refute_dispatch MiniTest::Spec.spec_type('Widget IntegrationXTest')
|
37
36
|
end
|
38
37
|
|
39
|
-
|
40
38
|
private
|
41
39
|
|
42
40
|
def assert_dispatch(actual)
|
@@ -46,5 +44,4 @@ class ActionControllerTest < MiniTestSpecRails::TestCase
|
|
46
44
|
def refute_dispatch(actual)
|
47
45
|
refute_equal ActionDispatch::IntegrationTest, actual
|
48
46
|
end
|
49
|
-
|
50
47
|
end
|
@@ -4,20 +4,19 @@ class NotificationMailer < ActionMailer::Base; end
|
|
4
4
|
class Notifications < ActionMailer::Base; end
|
5
5
|
|
6
6
|
class ActionMailerTest < MiniTestSpecRails::TestCase
|
7
|
-
|
8
7
|
it 'matches spec type for class constants' do
|
9
8
|
assert_mailer MiniTest::Spec.spec_type(NotificationMailer)
|
10
9
|
assert_mailer MiniTest::Spec.spec_type(Notifications)
|
11
10
|
end
|
12
11
|
|
13
12
|
it 'matches spec type for strings' do
|
14
|
-
assert_mailer MiniTest::Spec.spec_type(
|
15
|
-
assert_mailer MiniTest::Spec.spec_type(
|
16
|
-
assert_mailer MiniTest::Spec.spec_type(
|
13
|
+
assert_mailer MiniTest::Spec.spec_type('WidgetMailer')
|
14
|
+
assert_mailer MiniTest::Spec.spec_type('WidgetMailerTest')
|
15
|
+
assert_mailer MiniTest::Spec.spec_type('Widget Mailer Test')
|
17
16
|
# And is case sensitive
|
18
|
-
refute_mailer MiniTest::Spec.spec_type(
|
19
|
-
refute_mailer MiniTest::Spec.spec_type(
|
20
|
-
refute_mailer MiniTest::Spec.spec_type(
|
17
|
+
refute_mailer MiniTest::Spec.spec_type('widgetmailer')
|
18
|
+
refute_mailer MiniTest::Spec.spec_type('widgetmailertest')
|
19
|
+
refute_mailer MiniTest::Spec.spec_type('widget mailer test')
|
21
20
|
end
|
22
21
|
|
23
22
|
it 'wont match spec type for non space characters' do
|
@@ -25,10 +24,9 @@ class ActionMailerTest < MiniTestSpecRails::TestCase
|
|
25
24
|
refute_mailer MiniTest::Spec.spec_type("Widget Mailer\rTest")
|
26
25
|
refute_mailer MiniTest::Spec.spec_type("Widget Mailer\nTest")
|
27
26
|
refute_mailer MiniTest::Spec.spec_type("Widget Mailer\fTest")
|
28
|
-
refute_mailer MiniTest::Spec.spec_type(
|
27
|
+
refute_mailer MiniTest::Spec.spec_type('Widget MailerXTest')
|
29
28
|
end
|
30
29
|
|
31
|
-
|
32
30
|
private
|
33
31
|
|
34
32
|
def assert_mailer(actual)
|
@@ -38,5 +36,4 @@ class ActionMailerTest < MiniTestSpecRails::TestCase
|
|
38
36
|
def refute_mailer(actual)
|
39
37
|
refute_equal ActionMailer::TestCase, actual
|
40
38
|
end
|
41
|
-
|
42
39
|
end
|
@@ -1,25 +1,24 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
3
|
class ActionViewTest < MiniTestSpecRails::TestCase
|
4
|
-
|
5
4
|
it 'resolves spec type for matching helper strings' do
|
6
|
-
assert_view MiniTest::Spec.spec_type(
|
7
|
-
assert_view MiniTest::Spec.spec_type(
|
8
|
-
assert_view MiniTest::Spec.spec_type(
|
5
|
+
assert_view MiniTest::Spec.spec_type('WidgetHelper')
|
6
|
+
assert_view MiniTest::Spec.spec_type('WidgetHelperTest')
|
7
|
+
assert_view MiniTest::Spec.spec_type('Widget Helper Test')
|
9
8
|
# And is case sensitive
|
10
|
-
refute_view MiniTest::Spec.spec_type(
|
11
|
-
refute_view MiniTest::Spec.spec_type(
|
12
|
-
refute_view MiniTest::Spec.spec_type(
|
9
|
+
refute_view MiniTest::Spec.spec_type('widgethelper')
|
10
|
+
refute_view MiniTest::Spec.spec_type('widgethelpertest')
|
11
|
+
refute_view MiniTest::Spec.spec_type('widget helper test')
|
13
12
|
end
|
14
13
|
|
15
14
|
it 'resolves spec type for matching view strings' do
|
16
|
-
assert_view MiniTest::Spec.spec_type(
|
17
|
-
assert_view MiniTest::Spec.spec_type(
|
18
|
-
assert_view MiniTest::Spec.spec_type(
|
15
|
+
assert_view MiniTest::Spec.spec_type('WidgetView')
|
16
|
+
assert_view MiniTest::Spec.spec_type('WidgetViewTest')
|
17
|
+
assert_view MiniTest::Spec.spec_type('Widget View Test')
|
19
18
|
# And is case sensitive
|
20
|
-
refute_view MiniTest::Spec.spec_type(
|
21
|
-
refute_view MiniTest::Spec.spec_type(
|
22
|
-
refute_view MiniTest::Spec.spec_type(
|
19
|
+
refute_view MiniTest::Spec.spec_type('widgetview')
|
20
|
+
refute_view MiniTest::Spec.spec_type('widgetviewtest')
|
21
|
+
refute_view MiniTest::Spec.spec_type('widget view test')
|
23
22
|
end
|
24
23
|
|
25
24
|
it 'wont match spec type for non space characters' do
|
@@ -27,10 +26,9 @@ class ActionViewTest < MiniTestSpecRails::TestCase
|
|
27
26
|
refute_view MiniTest::Spec.spec_type("Widget Helper\rTest")
|
28
27
|
refute_view MiniTest::Spec.spec_type("Widget Helper\nTest")
|
29
28
|
refute_view MiniTest::Spec.spec_type("Widget Helper\fTest")
|
30
|
-
refute_view MiniTest::Spec.spec_type(
|
29
|
+
refute_view MiniTest::Spec.spec_type('Widget HelperXTest')
|
31
30
|
end
|
32
31
|
|
33
|
-
|
34
32
|
private
|
35
33
|
|
36
34
|
def assert_view(actual)
|
@@ -40,5 +38,4 @@ class ActionViewTest < MiniTestSpecRails::TestCase
|
|
40
38
|
def refute_view(actual)
|
41
39
|
refute_equal ActionView::TestCase, actual
|
42
40
|
end
|
43
|
-
|
44
41
|
end
|
@@ -1,44 +1,46 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
3
|
if defined?(ActiveJob)
|
4
|
-
class MyJob < ActiveJob::Base
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
it 'matches spec type for class constants' do
|
10
|
-
assert_job MiniTest::Spec.spec_type(MyJob)
|
11
|
-
assert_job MiniTest::Spec.spec_type(TrashableCleanupJob)
|
4
|
+
class MyJob < ActiveJob::Base
|
5
|
+
def perform(_record)
|
6
|
+
true
|
7
|
+
end
|
12
8
|
end
|
13
|
-
|
14
|
-
it 'matches spec type for strings' do
|
15
|
-
assert_job MiniTest::Spec.spec_type("WidgetJob")
|
16
|
-
assert_job MiniTest::Spec.spec_type("WidgetJobTest")
|
17
|
-
assert_job MiniTest::Spec.spec_type("Widget Job Test")
|
18
|
-
# And is case sensitive
|
19
|
-
refute_job MiniTest::Spec.spec_type("widgetmailer")
|
20
|
-
refute_job MiniTest::Spec.spec_type("widgetmailertest")
|
21
|
-
refute_job MiniTest::Spec.spec_type("widget mailer test")
|
9
|
+
class TrashableCleanupJob < MyJob
|
22
10
|
end
|
23
11
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
12
|
+
class ActiveJobTest < MiniTestSpecRails::TestCase
|
13
|
+
it 'matches spec type for class constants' do
|
14
|
+
assert_job MiniTest::Spec.spec_type(MyJob)
|
15
|
+
assert_job MiniTest::Spec.spec_type(TrashableCleanupJob)
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'matches spec type for strings' do
|
19
|
+
assert_job MiniTest::Spec.spec_type('WidgetJob')
|
20
|
+
assert_job MiniTest::Spec.spec_type('WidgetJobTest')
|
21
|
+
assert_job MiniTest::Spec.spec_type('Widget Job Test')
|
22
|
+
# And is case sensitive
|
23
|
+
refute_job MiniTest::Spec.spec_type('widgetmailer')
|
24
|
+
refute_job MiniTest::Spec.spec_type('widgetmailertest')
|
25
|
+
refute_job MiniTest::Spec.spec_type('widget mailer test')
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'wont match spec type for non space characters' do
|
29
|
+
refute_job MiniTest::Spec.spec_type("Widget Job\tTest")
|
30
|
+
refute_job MiniTest::Spec.spec_type("Widget Job\rTest")
|
31
|
+
refute_job MiniTest::Spec.spec_type("Widget Job\nTest")
|
32
|
+
refute_job MiniTest::Spec.spec_type("Widget Job\fTest")
|
33
|
+
refute_job MiniTest::Spec.spec_type('Widget JobXTest')
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
def assert_job(actual)
|
39
|
+
assert_equal ActiveJob::TestCase, actual
|
40
|
+
end
|
41
|
+
|
42
|
+
def refute_job(actual)
|
43
|
+
refute_equal ActiveJob::TestCase, actual
|
44
|
+
end
|
30
45
|
end
|
31
|
-
|
32
|
-
|
33
|
-
private
|
34
|
-
|
35
|
-
def assert_job(actual)
|
36
|
-
assert_equal ActiveJob::TestCase, actual
|
37
|
-
end
|
38
|
-
|
39
|
-
def refute_job(actual)
|
40
|
-
refute_equal ActiveJob::TestCase, actual
|
41
|
-
end
|
42
|
-
|
43
|
-
end
|
44
46
|
end
|
@@ -3,14 +3,13 @@ require 'test_helper'
|
|
3
3
|
class SomeRandomModel < ActiveRecord::Base; end
|
4
4
|
|
5
5
|
class ActiveSupportTest < MiniTestSpecRails::TestCase
|
6
|
-
|
7
6
|
it 'resolves spec type for active record constants' do
|
8
7
|
assert_support MiniTest::Spec.spec_type(SomeRandomModel)
|
9
8
|
assert_support MiniTest::Spec.spec_type(User)
|
10
9
|
end
|
11
10
|
|
12
11
|
it 'wont resolve spec type for random strings' do
|
13
|
-
assert_spec MiniTest::Spec.spec_type(
|
12
|
+
assert_spec MiniTest::Spec.spec_type('Unmatched String')
|
14
13
|
end
|
15
14
|
|
16
15
|
private
|
@@ -22,32 +21,32 @@ class ActiveSupportTest < MiniTestSpecRails::TestCase
|
|
22
21
|
def assert_spec(actual)
|
23
22
|
assert_equal MiniTest::Spec, actual
|
24
23
|
end
|
25
|
-
|
26
24
|
end
|
27
25
|
|
28
26
|
class ActiveSupportCallbackTest < ActiveSupport::TestCase
|
29
|
-
|
30
27
|
setup :foo
|
31
28
|
setup :bar
|
32
|
-
|
29
|
+
|
33
30
|
it 'works' do
|
34
31
|
@foo.must_equal 'foo'
|
35
32
|
@bar.must_equal 'bar'
|
36
33
|
end
|
37
|
-
|
34
|
+
|
38
35
|
private
|
39
|
-
|
40
|
-
def foo
|
41
|
-
|
42
|
-
|
36
|
+
|
37
|
+
def foo
|
38
|
+
@foo = 'foo'
|
39
|
+
end
|
40
|
+
|
41
|
+
def bar
|
42
|
+
@bar = 'bar'
|
43
|
+
end
|
43
44
|
end
|
44
45
|
|
45
46
|
class ActiveSupportSpecTest < ActiveSupport::TestCase
|
46
|
-
|
47
47
|
it 'current spec name' do
|
48
48
|
Thread.current[:current_spec].must_equal self
|
49
49
|
end
|
50
|
-
|
51
50
|
end
|
52
51
|
|
53
52
|
class ActiveSupportDescribeNamesTest < ActiveSupport::TestCase
|
@@ -66,3 +65,14 @@ class ActiveSupportDescribeNamesTest < ActiveSupport::TestCase
|
|
66
65
|
end
|
67
66
|
end
|
68
67
|
|
68
|
+
class ActiveSupportTestSyntaxTest < ActiveSupport::TestCase
|
69
|
+
test 'records the correct test method line number' do
|
70
|
+
method_name = public_methods(false).find do |name|
|
71
|
+
name.to_s =~ /test.*records the correct test method line number/
|
72
|
+
end
|
73
|
+
method_obj = method(method_name)
|
74
|
+
|
75
|
+
assert_match %r{test\/cases\/active_support_test.rb}, method_obj.source_location[0]
|
76
|
+
assert_equal 69, method_obj.source_location[1]
|
77
|
+
end
|
78
|
+
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'test_helper_dummy'
|
2
2
|
|
3
3
|
class PostTests < ActiveSupport::TestCase
|
4
|
-
|
5
4
|
i_suck_and_my_tests_are_order_dependent!
|
6
5
|
|
7
6
|
$teardown_ran = false
|
@@ -27,11 +26,8 @@ class PostTests < ActiveSupport::TestCase
|
|
27
26
|
end
|
28
27
|
|
29
28
|
context 'level 1' do
|
30
|
-
|
31
29
|
should 'work' do
|
32
30
|
@post.must_be_instance_of Post
|
33
31
|
end
|
34
|
-
|
35
32
|
end
|
36
|
-
|
37
33
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
{}
|