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
direct7-0.0.18 vendor/bundle/ruby/2.7.0/gems/minitest-5.20.0/test/minitest/test_minitest_test_task.rb
direct7-0.0.18 vendor/bundle/ruby/3.0.0/gems/minitest-5.20.0/test/minitest/test_minitest_test_task.rb
direct7-0.0.17 vendor/bundle/ruby/3.0.0/gems/minitest-5.20.0/test/minitest/test_minitest_test_task.rb
direct7-0.0.17 vendor/bundle/ruby/2.7.0/gems/minitest-5.20.0/test/minitest/test_minitest_test_task.rb
direct7-0.0.16 vendor/bundle/ruby/2.7.0/gems/minitest-5.20.0/test/minitest/test_minitest_test_task.rb
direct7-0.0.16 vendor/bundle/ruby/3.0.0/gems/minitest-5.20.0/test/minitest/test_minitest_test_task.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/minitest-5.18.1/test/minitest/test_minitest_test_task.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/minitest-5.18.1/test/minitest/test_minitest_test_task.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/minitest-5.18.1/test/minitest/test_minitest_test_task.rb
direct7-0.0.13 vendor/bundle/ruby/3.0.0/gems/minitest-5.20.0/test/minitest/test_minitest_test_task.rb
direct7-0.0.13 vendor/bundle/ruby/2.7.0/gems/minitest-5.20.0/test/minitest/test_minitest_test_task.rb
minitest-5.22.2 test/minitest/test_minitest_test_task.rb
minitest-5.22.1 test/minitest/test_minitest_test_task.rb
minitest-5.22.0 test/minitest/test_minitest_test_task.rb
direct7-0.0.12 vendor/bundle/ruby/3.0.0/gems/minitest-5.20.0/test/minitest/test_minitest_test_task.rb
direct7-0.0.12 vendor/bundle/ruby/2.7.0/gems/minitest-5.20.0/test/minitest/test_minitest_test_task.rb
mlh-rubocop-config-1.0.3 vendor/bundle/ruby/3.2.0/gems/minitest-5.21.2/test/minitest/test_minitest_test_task.rb
minitest-5.21.2 test/minitest/test_minitest_test_task.rb
minitest-5.21.1 test/minitest/test_minitest_test_task.rb
minitest-5.21.0 test/minitest/test_minitest_test_task.rb