Sha256: ec8d76b705099b35d1c57d8382bbdb62f4a138f15acf2e9f0b50cd67fd7ef248
Contents?: true
Size: 1.09 KB
Versions: 30
Compression:
Stored size: 1.09 KB
Contents
require_relative "../spec_helper" describe "environments plugin" do before do app app.plugin :environments, :development end it "adds environment accessor for getting/setting the environment" do app.environment.must_equal :development app.environment = :test app.environment.must_equal :test app.plugin :environments, :production app.environment.must_equal :production end it "adds predicates for testing the environment" do app.development?.must_equal true app.test?.must_equal false app.production?.must_equal false end it "adds configure method which yields if no arguments are given or an environment matches" do a = [] app.configure{a << 1} app.configure(:development){|ap| a << ap} app.configure(:test, :production){a << 2} a.must_equal [1, app] end it "defaults environment to RACK_ENV" do with_rack_env('test') do app(:environments){} end app.test?.must_equal true app.development?.must_equal false app(:environments){} app.test?.must_equal false app.development?.must_equal true end end
Version data entries
30 entries across 30 versions & 1 rubygems