<NME> environments_spec.rb
<BEF> # encoding: utf-8

require_relative "../spec_helper"
require "rango/environments"

describe "Rango environments" do
  it "should defaults to development" do
    pending "This should be part of test suite testing boot & default setup which obviously can't run in the same Ruby instance because all the requires etc are global"
    Rango.environment.should eql("development")
  end

  describe ".development?" do
    it "should be true if Rango.environment is 'development'" do
      Rango.should be_development
    end

    it "should be true if Rango.environment is included in Rango.development_environments" do
      Rango.environment = "foobar"
      Rango.should_not be_development
      Rango.development_environments.push("foobar")
      Rango.should be_development
    end
  end
  end

  describe ".production?" do
    %w{production stagging}.each do |environment|
      it "should be true if Rango.environment is '#{environment}'" do
        Rango.environment = environment
      end
    end

    it "should be true if Rango.environment is included in Rango.production_environments" do
      Rango.environment = "foobar"
      Rango.should_not be_production
      Rango.production_environments.push("foobar")
      Rango.should be_production
    end
  end
  end

  describe ".testing?" do
    %w{test spec cucumber}.each do |environment|
      it "should be true if Rango.environment is '#{environment}'" do
        Rango.environment = environment
      end
    end

    it "should be true if Rango.environment is included in Rango.testing_environments" do
      Rango.environment = "foobar"
      Rango.should_not be_testing
      Rango.testing_environments.push("foobar")
      Rango.should be_testing
    end
  end
  end

  describe ".environment?" do
    it "should returns true if current environment is the same as the only argument" do
      Rango.environment = "development"
      Rango.environment?("development").should be_true
    end

    it "should returns false if current environment is different than the only argument" do
      Rango.environment = "production"
      Rango.environment?("development").should be_false
    end
  end
end

<MSG> Rewritten environments support

<DFF> @@ -14,10 +14,10 @@ describe "Rango environments" do
       Rango.should be_development
     end
 
-    it "should be true if Rango.environment is included in Rango.development_environments" do
+    it "should be true if Rango.environment is included in Rango.environments[:development]" do
       Rango.environment = "foobar"
       Rango.should_not be_development
-      Rango.development_environments.push("foobar")
+      Rango.environments[:development].push("foobar")
       Rango.should be_development
     end
   end
@@ -30,10 +30,10 @@ describe "Rango environments" do
       end
     end
 
-    it "should be true if Rango.environment is included in Rango.production_environments" do
+    it "should be true if Rango.environment is included in Rango.environments[:production]" do
       Rango.environment = "foobar"
       Rango.should_not be_production
-      Rango.production_environments.push("foobar")
+      Rango.environments[:production].push("foobar")
       Rango.should be_production
     end
   end
@@ -46,10 +46,10 @@ describe "Rango environments" do
       end
     end
 
-    it "should be true if Rango.environment is included in Rango.testing_environments" do
+    it "should be true if Rango.environment is included in Rango.environments[:testing]" do
       Rango.environment = "foobar"
       Rango.should_not be_testing
-      Rango.testing_environments.push("foobar")
+      Rango.environments[:testing].push("foobar")
       Rango.should be_testing
     end
   end

Rewritten environments support