Add "exec" action to allow execution of arbitrary commands with the app's environment.

This commit is contained in:
Matt Griffin
2012-01-04 15:22:10 -05:00
parent fff15bc627
commit a34bc59721
4 changed files with 88 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
require "spec_helper"
describe "spec helpers" do
describe "#preserving_env" do
after { ENV.delete "FOO" }
it "should remove added environment vars" do
preserving_env { ENV["FOO"] = "baz" }
ENV["FOO"].should == nil
end
it "should reset modified environment vars" do
ENV["FOO"] = "bar"
preserving_env { ENV["FOO"] = "baz"}
ENV["FOO"].should == "bar"
end
end
end