Sha256: 670ee73794983b4babc6d3547b10d82b3616aae09fb985d861ae1acef4e12ade

Contents?: true

Size: 792 Bytes

Versions: 9

Compression:

Stored size: 792 Bytes

Contents

require "test_helper"

class CompilerStrategyTest < Minitest::Test
  def test_mtime_strategy_returned
    Webpacker.config.stub :compiler_strategy, "mtime" do
      assert_instance_of Webpacker::MtimeStrategy, Webpacker::CompilerStrategy.from_config
    end
  end

  def test_digest_strategy_returned
    Webpacker.config.stub :compiler_strategy, "digest" do
      assert_instance_of Webpacker::DigestStrategy, Webpacker::CompilerStrategy.from_config
    end
  end

  def test_raise_on_unknown_strategy
    Webpacker.config.stub :compiler_strategy, "other" do
      error = assert_raises do
        Webpacker::CompilerStrategy.from_config
      end

      assert_equal \
        "Unknown strategy 'other'. Available options are 'mtime' and 'digest'.",
        error.message
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
shakapacker-6.5.5 test/compiler_strategy_test.rb
shakapacker-6.5.4 test/compiler_strategy_test.rb
shakapacker-6.5.3 test/compiler_strategy_test.rb
shakapacker-6.5.2 test/compiler_strategy_test.rb
shakapacker-6.5.1 test/compiler_strategy_test.rb
shakapacker-6.5.0 test/compiler_strategy_test.rb
shakapacker-6.4.1 test/compiler_strategy_test.rb
shakapacker-6.4.0 test/compiler_strategy_test.rb
shakapacker-6.3.0 test/compiler_strategy_test.rb