Sha256: d0538f41df75df6dbe6d488cfa9cea2887422251b1edbe041aa0c9e956d5f286

Contents?: true

Size: 719 Bytes

Versions: 4

Compression:

Stored size: 719 Bytes

Contents

require File.join(File.dirname(__FILE__), "test_helper.rb")

class EnvironmentVarTest < Scope::TestCase
  setup do
    Ecology.reset
  end

  context "with environments in your ecology" do
    setup do
      set_up_ecology <<ECOLOGY_CONTENTS
{
  "application": "SomeApp",
  "environment-from": ["RACK_ENV"],
  "domain": {
    "property1" : {
      "env:staging": "value1",
      "env:development": "value2",
      "env:*": "value3"
    }
  }
}
ECOLOGY_CONTENTS

      ENV["RACK_ENV"] = nil
    end

    should "select the right environment value for a property" do
      ENV["RACK_ENV"] = "staging"
      Ecology.read
      assert_equal "value1", Ecology.property("domain::property1", :as => String)
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ecology-0.0.18 test/environment_var_test.rb
ecology-0.0.14 test/environment_var_test.rb
ecology-0.0.12 test/environment_var_test.rb
ecology-0.0.11 test/environment_var_test.rb