|
1 | 1 | describe LinuxAdmin::SubscriptionManager do
|
2 | 2 | context "#run!" do
|
3 | 3 | it "raises a CredentialError if the error message contained a credential error" do
|
4 |
| - result = AwesomeSpawn::CommandResult.new("stuff", "things", "invalid username or password", 1) |
| 4 | + result = AwesomeSpawn::CommandResult.new("stuff", "things", "invalid username or password", 55, 1) |
5 | 5 | err = AwesomeSpawn::CommandResultError.new("things", result)
|
6 | 6 | expect(LinuxAdmin::Common).to receive(:run!).and_raise(err)
|
7 | 7 |
|
8 | 8 | expect { subject.run!("stuff") }.to raise_error(LinuxAdmin::CredentialError)
|
9 | 9 | end
|
10 | 10 |
|
11 | 11 | it "raises a SubscriptionManagerError if the error message does not contain a credential error" do
|
12 |
| - result = AwesomeSpawn::CommandResult.new("stuff", "things", "not a credential error", 1) |
| 12 | + result = AwesomeSpawn::CommandResult.new("stuff", "things", "not a credential error", 55, 1) |
13 | 13 | err = AwesomeSpawn::CommandResultError.new("things", result)
|
14 | 14 | expect(LinuxAdmin::Common).to receive(:run!).and_raise(err)
|
15 | 15 |
|
|
205 | 205 |
|
206 | 206 | it "with invalid credentials" do
|
207 | 207 | run_options = ["subscription-manager orgs", {:params => {"--username=" => "BadUser", "--password=" => "BadPass"}}]
|
| 208 | + result = AwesomeSpawn::CommandResult.new("", "", "Invalid username or password. To create a login, please visit https://www.redhat.com/wapps/ugc/register.html", 55, 255) |
208 | 209 | error = AwesomeSpawn::CommandResultError.new(
|
209 | 210 | "",
|
210 |
| - double( |
211 |
| - :error => "Invalid username or password. To create a login, please visit https://www.redhat.com/wapps/ugc/register.html", |
212 |
| - :exit_status => 255 |
213 |
| - ) |
| 211 | + result |
214 | 212 | )
|
215 | 213 | expect(AwesomeSpawn).to receive(:run!).once.with(*run_options).and_raise(error)
|
216 | 214 | expect { described_class.new.organizations({:username => "BadUser", :password => "BadPass"}) }.to raise_error(LinuxAdmin::CredentialError)
|
|
0 commit comments