Sha256: c216d14cf9e7399973c5d0a04c89465f1853dd25be603bc8b5139d6d9e8d8169

Contents?: true

Size: 1.15 KB

Versions: 49

Compression:

Stored size: 1.15 KB

Contents

require "minitest/autorun"
require "hoe"

require "minitest/test_task"

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

class TestHoeTest < Minitest::Test
  PATH = "test/minitest/test_minitest_test_task.rb"

  mt_path = %w[lib test .].join File::PATH_SEPARATOR

  MT_EXPECTED = %W[-I#{mt_path} -w
                   -e '%srequire "#{PATH}"'
                   --].join(" ") + " "

  def test_make_test_cmd_for_minitest
    skip "Using TESTOPTS... skipping" if ENV["TESTOPTS"]

    require "minitest/test_task"

    framework = %(require "minitest/autorun"; )

    @tester = Minitest::TestTask.create :test do |t|
      t.test_globs = [PATH]
    end

    assert_equal MT_EXPECTED % [framework].join("; "), @tester.make_test_cmd
  end

  def test_make_test_cmd_for_minitest_prelude
    skip "Using TESTOPTS... skipping" if ENV["TESTOPTS"]

    require "minitest/test_task"

    prelude = %(require "other/file")
    framework = %(require "minitest/autorun"; )

    @tester = Minitest::TestTask.create :test do |t|
      t.test_prelude = prelude
      t.test_globs = [PATH]
    end

    assert_equal MT_EXPECTED % [prelude, framework].join("; "), @tester.make_test_cmd
  end
end

Version data entries

49 entries across 38 versions & 10 rubygems

Version Path
getargv-0.3.3-universal-darwin vendor/bundle/ruby/3.3.0/gems/minitest-5.20.0/test/minitest/test_minitest_test_task.rb
direct7-0.0.11 vendor/bundle/ruby/3.0.0/gems/minitest-5.20.0/test/minitest/test_minitest_test_task.rb
direct7-0.0.11 vendor/bundle/ruby/2.7.0/gems/minitest-5.20.0/test/minitest/test_minitest_test_task.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/minitest-5.16.2/test/minitest/test_minitest_test_task.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/minitest-5.16.3/test/minitest/test_minitest_test_task.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/minitest-5.18.1/test/minitest/test_minitest_test_task.rb
minitest-5.20.0 test/minitest/test_minitest_test_task.rb
minitest-5.19.0 test/minitest/test_minitest_test_task.rb
mlh-rubocop-config-1.0.2 vendor/bundle/ruby/3.2.0/gems/minitest-5.18.1/test/minitest/test_minitest_test_task.rb
fablicop-1.10.3 vendor/bundle/ruby/3.2.0/gems/minitest-5.18.0/test/minitest/test_minitest_test_task.rb
fablicop-1.10.3 vendor/bundle/ruby/3.2.0/gems/minitest-5.18.1/test/minitest/test_minitest_test_task.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/minitest-5.16.3/test/minitest/test_minitest_test_task.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/minitest-5.18.1/test/minitest/test_minitest_test_task.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/minitest-5.16.2/test/minitest/test_minitest_test_task.rb
rubypitaya-3.12.5 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/minitest-5.17.0/test/minitest/test_minitest_test_task.rb
minitest-5.18.1 test/minitest/test_minitest_test_task.rb
fablicop-1.10.2 vendor/bundle/ruby/3.2.0/gems/minitest-5.18.0/test/minitest/test_minitest_test_task.rb
fluent-plugin-google-cloud-logging-on-prem-0.1.0 vendor/ruby/3.1.0/gems/minitest-5.18.0/test/minitest/test_minitest_test_task.rb
mumukit-content-type-1.12.1 vendor/bundle/ruby/2.7.0/gems/minitest-5.18.0/test/minitest/test_minitest_test_task.rb
mumukit-content-type-1.12.0 vendor/bundle/ruby/2.7.0/gems/minitest-5.18.0/test/minitest/test_minitest_test_task.rb