Sha256: 599146da2707d834bf262a7625d516b9077b5f3041ba7caf8c663f1bc35c3a30

Contents?: true

Size: 940 Bytes

Versions: 41

Compression:

Stored size: 940 Bytes

Contents

require "test_helper"

class CommandTest < Minitest::Test
  def test_compile_command_returns_success_status_when_stale
    Webpacker.compiler.stub :stale?, true do
      Webpacker.compiler.stub :run_webpack, true do
        assert_equal true, Webpacker.commands.compile
      end
    end
  end

  def test_compile_command_returns_success_status_when_fresh
    Webpacker.compiler.stub :stale?, false do
      Webpacker.compiler.stub :run_webpack, true do
        assert_equal true, Webpacker.commands.compile
      end
    end
  end

  def test_compile_command_returns_failure_status_when_stale
    Webpacker.compiler.stub :stale?, true do
      Webpacker.compiler.stub :run_webpack, false do
        assert_equal false, Webpacker.commands.compile
      end
    end
  end

  def test_clean_command_works_with_nested_hashes_and_without_any_compiled_files
    File.stub :delete, true do
      assert Webpacker.commands.clean
    end
  end
end

Version data entries

41 entries across 41 versions & 3 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/webpacker-5.4.4/test/command_test.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/webpacker-5.4.4/test/command_test.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/webpacker-5.4.4/test/command_test.rb
jetpacker-0.7.0 test/command_test.rb
webpacker-5.4.4 test/command_test.rb
jetpacker-0.6.0 test/command_test.rb
webpacker-5.4.3 test/command_test.rb
webpacker-6.0.0.rc.2 test/command_test.rb
webpacker-5.4.2 test/command_test.rb
webpacker-5.4.1 test/command_test.rb
webpacker-6.0.0.rc.1 test/command_test.rb
webpacker-5.4.0 test/command_test.rb
webpacker-5.3.0 test/command_test.rb
webpacker-5.2.2 test/command_test.rb
webpacker-6.0.0.beta.7 test/command_test.rb
webpacker-6.0.0.beta.6 test/command_test.rb
webpacker-6.0.0.beta.5 test/command_test.rb
webpacker-6.0.0.beta.4 test/command_test.rb
webpacker-6.0.0.beta.3 test/command_test.rb
jetpacker-0.5.0 test/command_test.rb