This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
find . -name "*.wma*" -delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it "passes" do | |
stub_env "development" do | |
Rails.env.should be_development | |
end | |
Rails.env.should be_test | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def env | |
@_env ||= ActiveSupport::StringInquirer.new(ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development") | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def stub_env(new_env, &block) | |
original_env = Rails.env | |
Rails.instance_variable_set("@_env", ActiveSupport::StringInquirer.new(new_env)) | |
block.call | |
ensure | |
Rails.instance_variable_set("@_env", ActiveSupport::StringInquirer.new(original_env)) | |
end |
NewerOlder