ParamagicDev/snowpacker

View on GitHub
test/unit/env_test.rb

Summary

Maintainability
A
0 mins
Test Coverage
require "test_helper.rb"

class EnvTest < Minitest::Test
  def test_sets_env_vars_appropriately
    Snowpacker.configure
    Snowpacker.config.hostname = "hostname"

    # By default, only sets output_path, mount_dir, port, and hostname
    Snowpacker::Env.set_env_variables(Snowpacker.config)

    assert_equal Snowpacker.config.hostname, ENV["SNOWPACKER_HOSTNAME"]

    Snowpacker.config.hostname = nil
    Snowpacker::Env.set_env_variables(Snowpacker.config)

    assert Snowpacker.config.hostname.nil?
  end
end