Sha256: 529a1208a4ef2122561f409b934574e177407d24089c34fd7a8d1ee955d280b4

Contents?: true

Size: 1.44 KB

Versions: 14

Compression:

Stored size: 1.44 KB

Contents

require 'test_helper_dummy'

module UserTests
  extend ActiveSupport::Concern
  included do

    it 'works' do
      user_ken.must_be_instance_of User
    end

    test 'works with test' do
      user_ken.must_be_instance_of User
    end

    it 'allows custom assertions' do
      assert_not false
    end

    describe 'nested 1' do

      it('works') { skip }

      describe 'nested 2' do

        it('works') { skip }

      end

      test 'works with test' do
        user_ken.must_be_instance_of User
      end

    end
    
  end
end

class UserTest < ActiveSupport::TestCase
  include UserTests
  it 'reflects' do
    described_class.must_equal User
    self.class.described_class.must_equal User
  end
  describe 'level 1' do
    it 'reflects' do
      described_class.must_equal  User
      self.class.described_class.must_equal User
    end
    describe 'level 2' do
      it 'reflects' do
        described_class.must_equal  User
        self.class.described_class.must_equal User
      end
    end
  end
end

describe User do
  include UserTests
  it 'reflects' do
    described_class.must_equal User
    self.class.described_class.must_equal User
  end
  describe 'level 1' do
    it 'reflects' do
      described_class.must_equal User
      self.class.described_class.must_equal User
    end
    describe 'level 2' do
      it 'reflects' do
        described_class.must_equal User
        self.class.described_class.must_equal User
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
minitest-spec-rails-5.4.0 test/dummy_tests/user_test.rb
minitest-spec-rails-5.3.0 test/dummy_tests/user_test.rb
minitest-spec-rails-5.2.2 test/dummy_tests/user_test.rb
minitest-spec-rails-5.2.0 test/dummy_tests/user_test.rb
minitest-spec-rails-5.1.1 test/dummy_tests/user_test.rb
minitest-spec-rails-5.1.0 test/dummy_tests/user_test.rb
minitest-spec-rails-orangejulius-5.0.5.pre.orangejulius test/dummy_tests/user_test.rb
minitest-spec-rails-orangejulius-5.0.4.pre.orangejulius test/dummy_tests/user_test.rb
minitest-spec-rails-5.0.4 test/dummy_tests/user_test.rb
minitest-spec-rails-orangejulius-5.0.3.pre.orangejulius test/dummy_tests/user_test.rb
minitest-spec-rails-5.0.3 test/dummy_tests/user_test.rb
minitest-spec-rails-5.0.2 test/dummy_tests/user_test.rb
minitest-spec-rails-5.0.1 test/dummy_tests/user_test.rb
minitest-spec-rails-5.0.0 test/dummy_tests/user_test.rb