test/dummy_tests/user_test.rb in minitest-spec-rails-3.1.2 vs test/dummy_tests/user_test.rb in minitest-spec-rails-4.3.0
- old
+ new
@@ -1,72 +1,36 @@
require 'test_helper_dummy'
module UserTests
- def self.included(klass)
- klass.class_eval do
+ extend ActiveSupport::Concern
+ included do
- it 'works' do
- user_ken.must_be_instance_of User
- end
+ it 'works' do
+ user_ken.must_be_instance_of User
+ end
- it 'allows custom assertions' do
- assert_blank ''
- end
+ it 'allows custom assertions' do
+ assert_blank '' if rails3?
+ end
- describe 'nested 1' do
+ describe 'nested 1' do
- it('works') { skip }
+ it('works') { skip }
- describe 'nested 2' do
+ describe 'nested 2' do
- it('works') { skip }
+ it('works') { skip }
- end
-
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