Changeset 4242

Show
Ignore:
Timestamp:
01/09/08 03:35:23 (5 years ago)
Author:
cho45
Message:

lang/ruby/pit/test/pit_test.rb,
lang/ruby/pit/lib/pit.rb:

switch returns previous value

Location:
lang/ruby/pit
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/ruby/pit/lib/pit.rb

    r4241 r4242  
    5050                @@profile = Directory + "#{name}.yaml" 
    5151                config = self.config 
     52                ret = config["profile"] 
    5253                config["profile"] = name 
    5354                @@config.open("w") {|f| f << config.to_yaml } 
     55                ret 
    5456        end 
    5557 
  • lang/ruby/pit/test/pit_test.rb

    r4234 r4242  
    9898                assert_equal "bar", Pit.get("test")["password"] 
    9999 
    100                 Pit.switch("profile2") 
     100                r = Pit.switch("profile2") 
     101                assert_equal "default", r 
    101102                assert_equal "profile2", Pit.config["profile"] 
    102103                Pit.set("test", :data => {"username"=>"foo2","password"=>"bar2"})