spec/unit/mb/rest_gateway_spec.rb in motherbrain-1.3.0 vs spec/unit/mb/rest_gateway_spec.rb in motherbrain-1.4.0

- old
+ new

@@ -8,6 +8,21 @@ describe "#app" do it "returns MB::API::Application" do subject.app.should be_a(MB::API::Application) end end + + describe "constants" do + it "should set DEFAULT_PORT to $PORT" do + p = 12345 + ENV["PORT"] = p.to_s + load File.join(MB.app_root, "lib", "mb", "rest_gateway.rb") + expect(MB::RestGateway::DEFAULT_PORT).to eq(p) + end + + it "should set DEFAULT_PORT to 26100 if $PORT is not set" do + ENV.delete("PORT") + load File.join(MB.app_root, "lib", "mb", "rest_gateway.rb") + expect(MB::RestGateway::DEFAULT_PORT).to eq(26100) + end + end end