spec/engineyard/cli/api_spec.rb in engineyard-2.0.0.pre1 vs spec/engineyard/cli/api_spec.rb in engineyard-2.0.0.pre2

- old
+ new

@@ -6,9 +6,15 @@ write_eyrc({"api_token" => "asdf"}) EY::CLI::API.new('http://fake.local', EY::CLI::UI.new).token.should == "asdf" clean_eyrc end + it "uses the token specified token over the ENV token if passed" do + ENV['ENGINEYARD_API_TOKEN'] = 'envtoken' + EY::CLI::API.new('http://fake.local', EY::CLI::UI.new, 'specifiedtoken').token.should == 'specifiedtoken' + ENV.delete('ENGINEYARD_API_TOKEN') + end + it "uses the token from $ENGINEYARD_API_TOKEN if set" do ENV['ENGINEYARD_API_TOKEN'] = 'envtoken' EY::CLI::API.new('http://fake.local', EY::CLI::UI.new).token.should == 'envtoken' ENV.delete('ENGINEYARD_API_TOKEN') end