Sha256: 1621afc17ae3a6175bd2b1e2e91a60eb4f0ea6300d1b67ebda3bc67ad74b303a

Contents?: true

Size: 1.6 KB

Versions: 9

Compression:

Stored size: 1.6 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_blank '' if MiniTestSpecRails::Util.rails3?
    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
    describing_class.must_equal UserTest
    described_class.must_equal User
    self.class.described_class.must_equal User
  end
  describe 'level 1' do
    it 'reflects' do
      describing_class.must_equal UserTest
      described_class.must_equal  User
      self.class.described_class.must_equal User
    end
    describe 'level 2' do
      it 'reflects' do
        describing_class.must_equal UserTest
        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

9 entries across 9 versions & 1 rubygems

Version Path
minitest-spec-rails-4.7.11 test/dummy_tests/user_test.rb
minitest-spec-rails-4.7.10 test/dummy_tests/user_test.rb
minitest-spec-rails-4.7.9 test/dummy_tests/user_test.rb
minitest-spec-rails-4.7.8 test/dummy_tests/user_test.rb
minitest-spec-rails-4.7.7 test/dummy_tests/user_test.rb
minitest-spec-rails-4.7.6 test/dummy_tests/user_test.rb
minitest-spec-rails-4.7.5 test/dummy_tests/user_test.rb
minitest-spec-rails-4.7.4 test/dummy_tests/user_test.rb
minitest-spec-rails-4.7.3 test/dummy_tests/user_test.rb