vmfloaty 1.2.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,7 +16,7 @@ describe Service do
16
16
  it 'prompts the user for their password and retrieves a token' do
17
17
  config = { 'user' => 'first.last', 'url' => 'http://default.url' }
18
18
  service = Service.new(MockOptions.new, config)
19
- allow(STDOUT).to receive(:puts).with('Enter your http://default.url service password:')
19
+ allow($stdout).to receive(:puts).with('Enter your http://default.url service password:')
20
20
  allow(Commander::UI).to(receive(:password)
21
21
  .with('Enter your http://default.url service password:', '*')
22
22
  .and_return('hunter2'))
@@ -29,9 +29,9 @@ describe Service do
29
29
  it 'prompts the user for their username and password if the username is unknown' do
30
30
  config = { 'url' => 'http://default.url' }
31
31
  service = Service.new(MockOptions.new({}), config)
32
- allow(STDOUT).to receive(:puts).with 'Enter your http://default.url service username:'
33
- allow(STDOUT).to receive(:puts).with "\n"
34
- allow(STDIN).to receive(:gets).and_return('first.last')
32
+ allow($stdout).to receive(:puts).with 'Enter your http://default.url service username:'
33
+ allow($stdout).to receive(:puts).with "\n"
34
+ allow($stdin).to receive(:gets).and_return('first.last')
35
35
  allow(Commander::UI).to(receive(:password)
36
36
  .with('Enter your http://default.url service password:', '*')
37
37
  .and_return('hunter2'))
@@ -59,16 +59,16 @@ describe Service do
59
59
  it 'reports the status of a token' do
60
60
  config = {
61
61
  'user' => 'first.last',
62
- 'url' => 'http://default.url',
62
+ 'url' => 'http://default.url'
63
63
  }
64
64
  options = MockOptions.new('token' => 'token-value')
65
65
  service = Service.new(options, config)
66
66
  status = {
67
- 'ok' => true,
68
- 'user' => config['user'],
69
- 'created' => '2017-09-22 02:04:18 +0000',
70
- 'last_accessed' => '2017-09-22 02:04:28 +0000',
71
- 'reserved_hosts' => [],
67
+ 'ok' => true,
68
+ 'user' => config['user'],
69
+ 'created' => '2017-09-22 02:04:18 +0000',
70
+ 'last_accessed' => '2017-09-22 02:04:28 +0000',
71
+ 'reserved_hosts' => []
72
72
  }
73
73
  allow(Auth).to(receive(:token_status)
74
74
  .with(nil, config['url'], 'token-value')
@@ -8,14 +8,14 @@ class ServiceStub
8
8
  if os_types.keys[0] == 'abs_host_string'
9
9
  return {
10
10
  os_types.keys[0] => { 'hostname' => ['abs-hostname.delivery.puppetlabs.net'] },
11
- 'ok' => true,
11
+ 'ok' => true
12
12
  }
13
13
  end
14
14
 
15
15
  {
16
16
  os_types.keys[0] => { 'hostname' => 'vmpooler-hostname' },
17
- 'domain' => 'delivery.puppetlabs.net',
18
- 'ok' => true,
17
+ 'domain' => 'delivery.puppetlabs.net',
18
+ 'ok' => true
19
19
  }
20
20
  end
21
21