Sha256: 689cd278a7ec3eb457b7413f39f65b6997e929ac3e787d70f320c8e41fb803c3

Contents?: true

Size: 1.02 KB

Versions: 11

Compression:

Stored size: 1.02 KB

Contents

require "minitest/autorun"
require "hoe"

Hoe.load_plugins # make sure Hoe::Test is loaded

class TestHoeTest < MiniTest::Unit::TestCase
  def setup
    @tester = Module.new do
      include Hoe::Test

      extend self

      initialize_test

      def test_globs
        ['test/test_hoe_test.rb']
      end
    end
  end

  def test_make_test_cmd_with_different_testlibs
    expected = ['-w -Ilib:bin:test:. -e \'require "rubygems"; %s',
                'require "test/test_hoe_test.rb"',
                "' -- ",
               ].join

    testunit = %(require "test/unit"; )
    assert_equal expected % testunit, @tester.make_test_cmd

    @tester.testlib = :minitest
    autorun = %(require "minitest/autorun"; )
    assert_equal expected % autorun, @tester.make_test_cmd

    @tester.testlib = :none
    assert_equal expected % "", @tester.make_test_cmd

    @tester.testlib = :faketestlib
    e = assert_raises(RuntimeError) do
      @tester.make_test_cmd
    end

    assert_equal "unsupported test framework faketestlib", e.to_s
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
hoe-2.15.0 test/test_hoe_test.rb
hoe-2.14.0 test/test_hoe_test.rb
hoe-2.13.1 test/test_hoe_test.rb
hoe-2.13.0 test/test_hoe_test.rb
hoe-2.12.5 test/test_hoe_test.rb
hoe-2.12.4 test/test_hoe_test.rb
hoe-2.12.3 test/test_hoe_test.rb
hoe-2.12.2 test/test_hoe_test.rb
hoe-2.12.1 test/test_hoe_test.rb
hoe-2.12.0 test/test_hoe_test.rb
hoe-2.11.0 test/test_hoe_test.rb