diff options
Diffstat (limited to 'spec/ruby/core/env/invert_spec.rb')
-rw-r--r-- | spec/ruby/core/env/invert_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/ruby/core/env/invert_spec.rb b/spec/ruby/core/env/invert_spec.rb new file mode 100644 index 0000000000..42170230db --- /dev/null +++ b/spec/ruby/core/env/invert_spec.rb @@ -0,0 +1,16 @@ +require File.expand_path('../../../spec_helper', __FILE__) + +describe "ENV.invert" do + before :each do + ENV["foo"] = "bar" + end + + after :each do + ENV.delete "foo" + end + + it "returns a hash with ENV.keys as the values and vice versa" do + ENV.invert["bar"].should == "foo" + ENV["foo"].should == "bar" + end +end |