minitest-spec-rails 5.0.0 → 7.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/ci.yml +36 -0
  3. data/.gitignore +1 -2
  4. data/.rubocop.yml +26 -0
  5. data/Appraisals +13 -1
  6. data/CHANGELOG.md +130 -46
  7. data/CODE_OF_CONDUCT.md +31 -0
  8. data/Gemfile +0 -4
  9. data/README.md +63 -67
  10. data/Rakefile +6 -14
  11. data/gemfiles/rails_v6.0.x.gemfile +8 -0
  12. data/gemfiles/rails_v6.0.x.gemfile.lock +172 -0
  13. data/gemfiles/rails_v6.1.x.gemfile +8 -0
  14. data/gemfiles/rails_v6.1.x.gemfile.lock +175 -0
  15. data/gemfiles/rails_v7.0.x.gemfile +8 -0
  16. data/gemfiles/rails_v7.0.x.gemfile.lock +174 -0
  17. data/gemfiles/rails_v7.1.x.gemfile +9 -0
  18. data/lib/minitest-spec-rails/dsl.rb +6 -10
  19. data/lib/minitest-spec-rails/init/action_cable.rb +28 -0
  20. data/lib/minitest-spec-rails/init/action_controller.rb +3 -7
  21. data/lib/minitest-spec-rails/init/action_dispatch.rb +1 -3
  22. data/lib/minitest-spec-rails/init/action_mailer.rb +2 -7
  23. data/lib/minitest-spec-rails/init/action_view.rb +1 -5
  24. data/lib/minitest-spec-rails/init/active_job.rb +24 -0
  25. data/lib/minitest-spec-rails/init/active_support.rb +8 -11
  26. data/lib/minitest-spec-rails/init/mini_shoulda.rb +2 -6
  27. data/lib/minitest-spec-rails/parallelize.rb +30 -0
  28. data/lib/minitest-spec-rails/railtie.rb +24 -17
  29. data/lib/minitest-spec-rails/version.rb +1 -1
  30. data/minitest-spec-rails.gemspec +10 -9
  31. data/test/cases/action_cable_test.rb +38 -0
  32. data/test/cases/action_controller_test.rb +13 -16
  33. data/test/cases/action_dispatch_test.rb +18 -21
  34. data/test/cases/action_mailer_test.rb +13 -16
  35. data/test/cases/action_view_test.rb +17 -20
  36. data/test/cases/active_job_test.rb +46 -0
  37. data/test/cases/active_support_test.rb +28 -18
  38. data/test/cases/mini_shoulda_test.rb +6 -11
  39. data/test/dummy_app/app/assets/config/manifest.js +1 -0
  40. data/test/dummy_app/app/channels/application_cable/channel.rb +4 -0
  41. data/test/dummy_app/app/channels/application_cable/connection.rb +4 -0
  42. data/test/dummy_app/app/controllers/application_controller.rb +1 -3
  43. data/test/dummy_app/app/controllers/users_controller.rb +1 -3
  44. data/test/dummy_app/app/helpers/application_helper.rb +0 -1
  45. data/test/dummy_app/app/helpers/foos_helper.rb +3 -1
  46. data/test/dummy_app/app/helpers/users_helper.rb +1 -3
  47. data/test/dummy_app/app/mailers/user_mailer.rb +2 -4
  48. data/test/dummy_app/app/models/post.rb +0 -3
  49. data/test/dummy_app/app/models/user.rb +0 -3
  50. data/test/dummy_app/config/routes.rb +1 -1
  51. data/test/dummy_app/config/storage.yml +34 -0
  52. data/test/dummy_app/init.rb +18 -21
  53. data/test/dummy_app/tmp/development_secret.txt +1 -0
  54. data/test/dummy_tests/application_controller_test.rb +19 -25
  55. data/test/dummy_tests/{foo_helper_test.rb → foos_helper_test.rb} +2 -5
  56. data/test/dummy_tests/integration_test.rb +5 -11
  57. data/test/dummy_tests/library_test.rb +3 -3
  58. data/test/dummy_tests/special_users_controller_test.rb +10 -0
  59. data/test/dummy_tests/user_mailer_test.rb +24 -26
  60. data/test/dummy_tests/user_test.rb +15 -21
  61. data/test/dummy_tests/users_controller_test.rb +8 -4
  62. data/test/dummy_tests/users_helper_test.rb +15 -21
  63. data/test/support/shared_test_case_behavior.rb +4 -7
  64. data/test/test_helper.rb +1 -5
  65. data/test/test_helper_dummy.rb +5 -7
  66. metadata +87 -74
  67. data/.travis.yml +0 -11
  68. data/Guardfile +0 -7
  69. data/test/support/minitest.rb +0 -1
@@ -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
- assert_support MiniTest::Spec.spec_type(SomeRandomModel)
9
- assert_support MiniTest::Spec.spec_type(User)
7
+ assert_support Minitest::Spec.spec_type(SomeRandomModel)
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("Unmatched String")
12
+ assert_spec Minitest::Spec.spec_type('Unmatched String')
14
13
  end
15
14
 
16
15
  private
@@ -20,34 +19,34 @@ class ActiveSupportTest < MiniTestSpecRails::TestCase
20
19
  end
21
20
 
22
21
  def assert_spec(actual)
23
- assert_equal MiniTest::Spec, actual
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
- @foo.must_equal 'foo'
35
- @bar.must_equal 'bar'
31
+ expect(@foo).must_equal 'foo'
32
+ expect(@bar).must_equal 'bar'
36
33
  end
37
-
34
+
38
35
  private
39
-
40
- def foo ; @foo = 'foo' ; end
41
- def bar ; @bar = 'bar' ; end
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
- Thread.current[:current_spec].must_equal self
48
+ expect(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,9 +1,8 @@
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
8
7
 
9
8
  setup do
@@ -14,25 +13,21 @@ class PostTests < ActiveSupport::TestCase
14
13
  $teardown_ran = true
15
14
  end
16
15
 
17
- should 'setup correctly and $teardown_ran should still be false since this is the first test' do
18
- @post.must_be_instance_of Post
19
- $teardown_ran.must_equal false
16
+ should 'setup correctly' do
17
+ expect(@post).must_be_instance_of Post
20
18
  end
21
19
 
22
20
  should 'teardown correctly' do
23
- $teardown_ran.must_equal true
21
+ expect($teardown_ran).must_equal true
24
22
  end
25
23
 
26
24
  should_eventually 'will be skipped' do
27
25
  assert false
28
26
  end
29
-
30
- context 'level 1' do
31
27
 
28
+ context 'level 1' do
32
29
  should 'work' do
33
- @post.must_be_instance_of Post
30
+ expect(@post).must_be_instance_of Post
34
31
  end
35
-
36
32
  end
37
-
38
33
  end
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Channel < ActionCable::Channel::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Connection < ActionCable::Connection::Base
3
+ end
4
+ end
@@ -1,7 +1,5 @@
1
1
  class ApplicationController < ActionController::Base
2
-
3
2
  def index
4
- render :text => 'Rendered MiniTest::Spec', :layout => false
3
+ render html: '<h1>Rendered Minitest::Spec</h1>'.html_safe, layout: false
5
4
  end
6
-
7
5
  end
@@ -1,12 +1,10 @@
1
1
  class UsersController < ApplicationController
2
-
3
2
  def index
4
3
  @users = User.all
5
- render :layout => false
4
+ render layout: false
6
5
  end
7
6
 
8
7
  def update
9
8
  redirect_to users_url
10
9
  end
11
-
12
10
  end
@@ -1,3 +1,2 @@
1
1
  module ApplicationHelper
2
-
3
2
  end
@@ -2,10 +2,12 @@ module FoosHelper
2
2
  def passes
3
3
  true
4
4
  end
5
+
5
6
  def users_path_helper
6
7
  users_path
7
8
  end
9
+
8
10
  def users_url_helper
9
11
  users_url
10
12
  end
11
- end
13
+ end
@@ -1,9 +1,7 @@
1
1
  module UsersHelper
2
-
3
2
  def render_users_list(users)
4
3
  content_tag :ul do
5
- users.map{ |user| content_tag :li, user.email }.join.html_safe
4
+ users.map { |user| content_tag :li, user.email }.join.html_safe
6
5
  end
7
6
  end
8
-
9
7
  end
@@ -1,10 +1,8 @@
1
1
  class UserMailer < ActionMailer::Base
2
-
3
- default :from => 'rails@minitest.spec'
2
+ default from: 'rails@minitest.spec'
4
3
 
5
4
  def welcome(user)
6
5
  @user = user
7
- mail :to => @user.email, :subject => 'Welcome', :body => "Welcome to MiniTest::Spec #{@user.email}!"
6
+ mail to: @user.email, subject: 'Welcome', body: "Welcome to Minitest::Spec #{@user.email}!"
8
7
  end
9
-
10
8
  end
@@ -1,6 +1,3 @@
1
1
  class Post < ActiveRecord::Base
2
-
3
2
  belongs_to :user
4
-
5
-
6
3
  end
@@ -1,6 +1,3 @@
1
1
  class User < ActiveRecord::Base
2
-
3
2
  has_many :posts
4
-
5
-
6
3
  end
@@ -1,4 +1,4 @@
1
1
  Dummy::Application.routes.draw do
2
- root :to => 'application#index'
2
+ root to: 'application#index'
3
3
  resources :users
4
4
  end
@@ -0,0 +1,34 @@
1
+ test:
2
+ service: Disk
3
+ root: <%= Rails.root.join("tmp/storage") %>
4
+
5
+ local:
6
+ service: Disk
7
+ root: <%= Rails.root.join("storage") %>
8
+
9
+ # Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
10
+ # amazon:
11
+ # service: S3
12
+ # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
13
+ # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
14
+ # region: us-east-1
15
+ # bucket: your_own_bucket
16
+
17
+ # Remember not to checkin your GCS keyfile to a repository
18
+ # google:
19
+ # service: GCS
20
+ # project: your_project
21
+ # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
22
+ # bucket: your_own_bucket
23
+
24
+ # Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
25
+ # microsoft:
26
+ # service: AzureStorage
27
+ # storage_account_name: your_account_name
28
+ # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
29
+ # container: your_container_name
30
+
31
+ # mirror:
32
+ # service: Mirror
33
+ # primary: local
34
+ # mirrors: [ amazon, google, microsoft ]
@@ -1,42 +1,39 @@
1
- ENV['RAILS_ENV'] = 'test'
2
- require 'rubygems'
3
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __FILE__)
1
+ ENV['RAILS_ENV'] ||= 'test'
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __dir__)
4
3
  require 'bundler/setup'
5
4
  require 'rails/all'
6
- Bundler.require :default, :development, :test
5
+ Bundler.require(:default, Rails.env)
6
+ require 'minitest/focus'
7
+ require 'pry'
7
8
 
8
9
  module Dummy
9
- class Application < ::Rails::Application
10
-
10
+ class Application < ::Rails::Application
11
11
  # Basic Engine
12
12
  config.root = File.join __FILE__, '..'
13
13
  config.cache_store = :memory_store
14
- config.assets.enabled = false if Rails.version > '3.1'
14
+ config.assets.enabled = false if Rails.version < '7.0.0'
15
15
  config.secret_token = '012345678901234567890123456789'
16
-
16
+ config.active_support.test_order = :random
17
17
  # Mimic Test Environment Config.
18
- config.whiny_nils = true if Rails.version < '4.0'
18
+ config.whiny_nils = true
19
19
  config.consider_all_requests_local = true
20
20
  config.action_controller.perform_caching = false
21
21
  config.action_dispatch.show_exceptions = false
22
22
  config.action_controller.allow_forgery_protection = false
23
23
  config.action_mailer.delivery_method = :test
24
24
  config.active_support.deprecation = :stderr
25
- if Rails.version < '4.0'
26
- config.threadsafe!
27
- else
28
- config.allow_concurrency = true
29
- config.cache_classes = true
30
- config.dependency_loading = true
31
- config.preload_frameworks = true
32
- config.eager_load = true
33
- config.secret_key_base = '012345678901234567890123456789'
34
- end
35
-
25
+ config.allow_concurrency = true
26
+ config.cache_classes = true
27
+ config.dependency_loading = true
28
+ config.preload_frameworks = true
29
+ config.eager_load = true
36
30
  # Custom
37
31
  config.minitest_spec_rails.mini_shoulda = true
38
-
39
32
  end
40
33
  end
41
34
 
42
35
  Dummy::Application.initialize!
36
+ require 'rails/test_help'
37
+
38
+ # Avoids local NoMethodError: undefined method `split' for nil:NilClass
39
+ Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1 @@
1
+ f45200b1a337dea2b5a19a5ff07a057008eabe34dd706a01bd3c7f8b744e2d094f3fa3cd681d7d8aeb0a317d65cc26749c11acdada6684dc092e6bdc928c0884
@@ -3,60 +3,54 @@ require 'test_helper_dummy'
3
3
  module ApplicationControllerTests
4
4
  extend ActiveSupport::Concern
5
5
  included do
6
-
7
6
  before { get :index }
8
7
 
9
8
  it 'works' do
10
9
  get :index
11
- response.body.must_equal 'Rendered MiniTest::Spec'
10
+ expect(response.body).must_equal '<h1>Rendered Minitest::Spec</h1>'
12
11
  end
13
12
 
14
13
  it 'allows custom assertions' do
15
- assert_template :partial => false
14
+ assert_select 'h1', text: 'Rendered Minitest::Spec'
16
15
  end
17
16
 
18
17
  it 'can find the controller_class' do
19
- self.class.controller_class.must_equal ApplicationController
18
+ expect(self.class.controller_class).must_equal ApplicationController
20
19
  end
21
20
 
22
21
  it 'can access the setup ivars' do
23
- @controller.must_be_kind_of ApplicationController
22
+ expect(@controller).must_be_kind_of ApplicationController
24
23
  end
25
24
 
26
25
  describe 'nested 1' do
27
-
28
26
  it('works') { skip }
29
27
 
30
28
  it 'can find the controller_class' do
31
- self.class.controller_class.must_equal ApplicationController
29
+ expect(self.class.controller_class).must_equal ApplicationController
32
30
  end
33
31
 
34
32
  describe 'nested 2' do
35
-
36
33
  it('works') { skip }
37
-
38
34
  end
39
-
40
35
  end
41
-
42
36
  end
43
37
  end
44
38
 
45
39
  class ApplicationControllerTest < ActionController::TestCase
46
40
  include ApplicationControllerTests
47
41
  it 'reflects' do
48
- described_class.must_equal ApplicationController
49
- self.class.described_class.must_equal ApplicationController
42
+ expect(described_class).must_equal ApplicationController
43
+ expect(self.class.described_class).must_equal ApplicationController
50
44
  end
51
45
  describe 'level 1' do
52
46
  it 'reflects' do
53
- described_class.must_equal ApplicationController
54
- self.class.described_class.must_equal ApplicationController
47
+ expect(described_class).must_equal ApplicationController
48
+ expect(self.class.described_class).must_equal ApplicationController
55
49
  end
56
50
  describe 'level 2' do
57
51
  it 'reflects' do
58
- described_class.must_equal ApplicationController
59
- self.class.described_class.must_equal ApplicationController
52
+ expect(described_class).must_equal ApplicationController
53
+ expect(self.class.described_class).must_equal ApplicationController
60
54
  end
61
55
  end
62
56
  end
@@ -65,22 +59,22 @@ end
65
59
  describe ApplicationController do
66
60
  include ApplicationControllerTests
67
61
  it 'class reflects' do
68
- described_class.must_equal ApplicationController
69
- self.class.described_class.must_equal ApplicationController
62
+ expect(described_class).must_equal ApplicationController
63
+ expect(self.class.described_class).must_equal ApplicationController
70
64
  end
71
65
  it 'reflects' do
72
- described_class.must_equal ApplicationController
73
- self.class.described_class.must_equal ApplicationController
66
+ expect(described_class).must_equal ApplicationController
67
+ expect(self.class.described_class).must_equal ApplicationController
74
68
  end
75
69
  describe 'level 1' do
76
70
  it 'reflects' do
77
- described_class.must_equal ApplicationController
78
- self.class.described_class.must_equal ApplicationController
71
+ expect(described_class).must_equal ApplicationController
72
+ expect(self.class.described_class).must_equal ApplicationController
79
73
  end
80
74
  describe 'level 2' do
81
75
  it 'reflects' do
82
- described_class.must_equal ApplicationController
83
- self.class.described_class.must_equal ApplicationController
76
+ expect(described_class).must_equal ApplicationController
77
+ expect(self.class.described_class).must_equal ApplicationController
84
78
  end
85
79
  end
86
80
  end
@@ -1,10 +1,9 @@
1
1
  require 'test_helper_dummy'
2
2
 
3
3
  class FoosHelperTest < ActionView::TestCase
4
-
5
4
  it 'allows path and url helpers' do
6
- users_path_helper.must_equal '/users'
7
- users_url_helper.must_equal 'http://test.host/users'
5
+ expect(users_path_helper).must_equal '/users'
6
+ expect(users_url_helper).must_equal 'http://test.host/users'
8
7
  end
9
8
 
10
9
  describe 'level1' do
@@ -12,6 +11,4 @@ class FoosHelperTest < ActionView::TestCase
12
11
  assert passes
13
12
  end
14
13
  end
15
-
16
14
  end
17
-
@@ -3,38 +3,32 @@ require 'test_helper_dummy'
3
3
  module IntegrationTests
4
4
  extend ActiveSupport::Concern
5
5
  included do
6
-
7
6
  fixtures :all
8
7
 
9
8
  it 'works' do
10
9
  get root_path
11
- status.must_equal 200
10
+ expect(status).must_equal 200
12
11
  end
13
12
 
14
13
  it 'works with assert_routing' do
15
- assert_routing '/', :controller => 'application', :action => 'index'
14
+ assert_routing '/', controller: 'application', action: 'index'
16
15
  end
17
16
 
18
17
  it 'can find the app' do
19
- app.must_be_instance_of Dummy::Application
18
+ expect(app).must_be_instance_of Dummy::Application
20
19
  end
21
20
 
22
21
  describe 'nested 1' do
23
-
24
22
  it('works') { skip }
25
23
 
26
24
  it 'can find the app' do
27
- app.must_be_instance_of Dummy::Application
25
+ expect(app).must_be_instance_of Dummy::Application
28
26
  end
29
27
 
30
28
  describe 'nested 2' do
31
-
32
29
  it('works') { skip }
33
-
34
30
  end
35
-
36
31
  end
37
-
38
32
  end
39
33
  end
40
34
 
@@ -44,6 +38,6 @@ end
44
38
 
45
39
  class AppTest < ActionDispatch::IntegrationTest
46
40
  def test_homepage
47
- assert_routing '/', :controller => 'application', :action => 'index'
41
+ assert_routing '/', controller: 'application', action: 'index'
48
42
  end
49
43
  end
@@ -3,13 +3,13 @@ require "#{Dummy::Application.root}/lib/library"
3
3
 
4
4
  class LibraryTest < ActiveSupport::TestCase
5
5
  it 'reflects' do
6
- described_class.must_equal Library
6
+ expect(described_class).must_equal Library
7
7
  end
8
8
  end
9
9
 
10
10
  describe Library do
11
11
  it 'reflects' do
12
- described_class.must_equal Library
13
- self.class.described_class.must_equal Library
12
+ expect(described_class).must_equal Library
13
+ expect(self.class.described_class).must_equal Library
14
14
  end
15
15
  end
@@ -0,0 +1,10 @@
1
+ require 'test_helper_dummy'
2
+
3
+ class SpecialUsersControllerTest < ActionController::TestCase
4
+ tests UsersController
5
+
6
+ it 'works' do
7
+ get :index
8
+ assert_select 'h1', "All #{User.count} Users"
9
+ end
10
+ end
@@ -3,18 +3,21 @@ require 'test_helper_dummy'
3
3
  module UserMailerTests
4
4
  extend ActiveSupport::Concern
5
5
  included do
6
-
7
6
  let(:deliveries) { ActionMailer::Base.deliveries }
8
7
  let(:user_mailer_class) { UserMailer }
9
- let(:user_email) { user_mailer_class.welcome(user_ken).deliver }
8
+ let(:user_email) do
9
+ user_mailer_class.welcome(user_ken).tap do |mail|
10
+ mail.deliver_now
11
+ end
12
+ end
10
13
 
11
14
  it 'works' do
12
- deliveries.must_be :empty?
15
+ expect(deliveries).must_be :empty?
13
16
  user_email
14
- deliveries.wont_be :empty?
15
- user_email.to.must_equal [user_ken.email]
16
- user_email.from.must_equal ['rails@minitest.spec']
17
- user_email.body.encoded.must_equal "Welcome to MiniTest::Spec #{user_ken.email}!"
17
+ expect(deliveries).wont_be :empty?
18
+ expect(user_email.to).must_equal [user_ken.email]
19
+ expect(user_email.from).must_equal ['rails@minitest.spec']
20
+ expect(user_email.body.encoded).must_equal "Welcome to Minitest::Spec #{user_ken.email}!"
18
21
  end
19
22
 
20
23
  it 'allows custom assertions' do
@@ -22,43 +25,38 @@ module UserMailerTests
22
25
  end
23
26
 
24
27
  it 'can find the mailer_class' do
25
- self.class.mailer_class.must_equal user_mailer_class
28
+ expect(self.class.mailer_class).must_equal user_mailer_class
26
29
  end
27
30
 
28
31
  describe 'nested 1' do
29
-
30
32
  it('works') { skip }
31
33
 
32
34
  it 'can find the mailer_class' do
33
- self.class.mailer_class.must_equal user_mailer_class
35
+ expect(self.class.mailer_class).must_equal user_mailer_class
34
36
  end
35
37
 
36
38
  describe 'nested 2' do
37
-
38
39
  it('works') { skip }
39
-
40
40
  end
41
-
42
41
  end
43
-
44
42
  end
45
43
  end
46
44
 
47
45
  class UserMailerTest < ActionMailer::TestCase
48
46
  include UserMailerTests
49
47
  it 'reflects' do
50
- described_class.must_equal UserMailer
51
- self.class.described_class.must_equal UserMailer
48
+ expect(described_class).must_equal UserMailer
49
+ expect(self.class.described_class).must_equal UserMailer
52
50
  end
53
51
  describe 'level 1' do
54
52
  it 'reflects' do
55
- described_class.must_equal UserMailer
56
- self.class.described_class.must_equal UserMailer
53
+ expect(described_class).must_equal UserMailer
54
+ expect(self.class.described_class).must_equal UserMailer
57
55
  end
58
56
  describe 'level 2' do
59
57
  it 'reflects' do
60
- described_class.must_equal UserMailer
61
- self.class.described_class.must_equal UserMailer
58
+ expect(described_class).must_equal UserMailer
59
+ expect(self.class.described_class).must_equal UserMailer
62
60
  end
63
61
  end
64
62
  end
@@ -67,18 +65,18 @@ end
67
65
  describe UserMailer do
68
66
  include UserMailerTests
69
67
  it 'reflects' do
70
- described_class.must_equal UserMailer
71
- self.class.described_class.must_equal UserMailer
68
+ expect(described_class).must_equal UserMailer
69
+ expect(self.class.described_class).must_equal UserMailer
72
70
  end
73
71
  describe 'level 1' do
74
72
  it 'reflects' do
75
- described_class.must_equal UserMailer
76
- self.class.described_class.must_equal UserMailer
73
+ expect(described_class).must_equal UserMailer
74
+ expect(self.class.described_class).must_equal UserMailer
77
75
  end
78
76
  describe 'level 2' do
79
77
  it 'reflects' do
80
- described_class.must_equal UserMailer
81
- self.class.described_class.must_equal UserMailer
78
+ expect(described_class).must_equal UserMailer
79
+ expect(self.class.described_class).must_equal UserMailer
82
80
  end
83
81
  end
84
82
  end