Sha256: ec5406d47021bf22bf4b8781d3c29e20013c965cb627c8017002e28b3c7e8dc8
Contents?: true
Size: 937 Bytes
Versions: 9
Compression:
Stored size: 937 Bytes
Contents
require 'spec_helper' describe EyProCli do describe "login" do context "with a valid user and password" do it "writes the token" do create_core_credentials end it "updates the token if it does not match" do create_core_credentials output = capture(:stdout) { subject.login } expect(output).to match(/token does not match/i) end it "does not update the token if it already exists" do create_core_credentials yaml = read_yaml(@tempfile) expect(yaml).to have_key("https://api.engineyard.com/") allow(subject.unauthenticated_core_client).to receive(:get_api_token) { Ey::Core::Response.new( :body => {"api_token" => yaml["https://api.engineyard.com/"]} ) } output = capture(:stdout) { subject.login } expect(output).to match(/token already exists/i) end end end end
Version data entries
9 entries across 9 versions & 1 rubygems