Sha256: 66a067439f34f0632b712cd6ce7f8263cdc43fa4639a199a1fd21411f5782928

Contents?: true

Size: 874 Bytes

Versions: 16

Compression:

Stored size: 874 Bytes

Contents

require "test_helper"

class EngineRakeTasksTest < Minitest::Test
  def setup
    remove_webpack_binstubs
  end

  def teardown
    remove_webpack_binstubs
  end

  def test_task_mounted
    output = Dir.chdir(mounted_app_path) { `rake -T` }
    assert_includes output, "app:webpacker"
  end

  def test_binstubs
    Dir.chdir(mounted_app_path) { `bundle exec rake app:webpacker:binstubs` }
    webpack_binstub_paths.each { |path| assert File.exist?(path) }
  end

  private
    def mounted_app_path
      File.expand_path("mounted_app", __dir__)
    end

    def webpack_binstub_paths
      [
        "#{mounted_app_path}/test/dummy/bin/webpack",
        "#{mounted_app_path}/test/dummy/bin/webpack-dev-server",
      ]
    end

    def remove_webpack_binstubs
      webpack_binstub_paths.each do |path|
        File.delete(path) if File.exist?(path)
      end
    end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
webpacker-6.0.0.rc.6 test/engine_rake_tasks_test.rb
webpacker-6.0.0.rc.5 test/engine_rake_tasks_test.rb
webpacker-6.0.0.rc.4 test/engine_rake_tasks_test.rb
webpacker-6.0.0.rc.3 test/engine_rake_tasks_test.rb
webpacker-6.0.0.rc.2 test/engine_rake_tasks_test.rb
webpacker-6.0.0.rc.1 test/engine_rake_tasks_test.rb
webpacker-6.0.0.beta.7 test/engine_rake_tasks_test.rb
webpacker-6.0.0.beta.6 test/engine_rake_tasks_test.rb
webpacker-6.0.0.beta.5 test/engine_rake_tasks_test.rb
webpacker-6.0.0.beta.4 test/engine_rake_tasks_test.rb
webpacker-6.0.0.beta.3 test/engine_rake_tasks_test.rb
webpacker-6.0.0.beta.2 test/engine_rake_tasks_test.rb
webpacker-6.0.0.beta.1 test/engine_rake_tasks_test.rb
webpacker-6.0.0.beta test/engine_rake_tasks_test.rb
webpacker-6.0.0.pre.2 test/engine_rake_tasks_test.rb
webpacker-6.0.0.pre.1 test/engine_rake_tasks_test.rb