Sha256: 84a2c0e6fa130f194f545ae9e121d2eac9c29c6deac26ade317081353947ac7a

Contents?: true

Size: 841 Bytes

Versions: 6

Compression:

Stored size: 841 Bytes

Contents

require 'test_helper'

class SomeRandomModel < ActiveRecord::Base; end

class ActiveSupportTest < MiniTestSpecRails::TestCase

  it 'resolves spect type for active record constants' do
    assert_support MiniTest::Spec.spec_type(SomeRandomModel)
    assert_support MiniTest::Spec.spec_type(User)
  end

  it 'wont resolve spect type for random strings' do
    assert_spec MiniTest::Spec.spec_type("Unmatched String")
  end

  private

  def assert_support(actual)
    assert_equal ActiveSupport::TestCase, actual
  end

  def assert_spec(actual)
    assert_equal MiniTest::Spec, actual
  end

end

class ActiveSupportCallbackTest < ActiveSupport::TestCase
 
  setup :foo
  setup :bar
 
  it 'works' do
    @foo.must_equal 'foo'
    @bar.must_equal 'bar'
  end
 
  private
 
  def foo ; @foo = 'foo' ; end
  def bar ; @bar = 'bar' ; end
 
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
minitest-spec-rails-3.1.2 test/cases/active_support_test.rb
minitest-spec-rails-4.7.2 test/cases/active_support_test.rb
minitest-spec-rails-4.7.1 test/cases/active_support_test.rb
minitest-spec-rails-3.1.1 test/cases/active_support_test.rb
minitest-spec-rails-3.1.0 test/cases/active_support_test.rb
minitest-spec-rails-4.7.0 test/cases/active_support_test.rb