Sha256: 5ebfbcd4cde2f634d5f470d8d943996846cfa0e32329cb2ed6584a28cd7de16b

Contents?: true

Size: 1.22 KB

Versions: 14

Compression:

Stored size: 1.22 KB

Contents

require "minitest/autorun"
require "hoe"

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

class TestHoeTest < Minitest::Test
  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
    skip "Using TESTOPTS... skipping" if ENV["TESTOPTS"]

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

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

    @tester.testlib = :testunit
    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

14 entries across 14 versions & 1 rubygems

Version Path
hoe-3.17.2 test/test_hoe_test.rb
hoe-3.17.1 test/test_hoe_test.rb
hoe-3.17.0 test/test_hoe_test.rb
hoe-3.16.2 test/test_hoe_test.rb
hoe-3.16.1 test/test_hoe_test.rb
hoe-3.16.0 test/test_hoe_test.rb
hoe-3.15.3 test/test_hoe_test.rb
hoe-3.15.2 test/test_hoe_test.rb
hoe-3.15.1 test/test_hoe_test.rb
hoe-3.15.0 test/test_hoe_test.rb
hoe-3.14.2 test/test_hoe_test.rb
hoe-3.14.1 test/test_hoe_test.rb
hoe-3.14.0 test/test_hoe_test.rb
hoe-3.13.1 test/test_hoe_test.rb