hammer_cli_foreman 3.6.0 → 3.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/doc/release_notes.md +13 -0
  3. data/lib/hammer_cli_foreman/command_extensions/update_common.rb +1 -1
  4. data/lib/hammer_cli_foreman/commands.rb +2 -4
  5. data/lib/hammer_cli_foreman/compute_resource/utils.rb +7 -7
  6. data/lib/hammer_cli_foreman/exception_handler.rb +2 -8
  7. data/lib/hammer_cli_foreman/external_usergroup.rb +0 -2
  8. data/lib/hammer_cli_foreman/resource_supported_test.rb +1 -1
  9. data/lib/hammer_cli_foreman/testing/api_expectations.rb +2 -2
  10. data/lib/hammer_cli_foreman/version.rb +1 -1
  11. data/locale/ca/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  12. data/locale/cs_CZ/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  13. data/locale/de/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  14. data/locale/en/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  15. data/locale/en_GB/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  16. data/locale/es/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  17. data/locale/fr/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  18. data/locale/it/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  19. data/locale/ja/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  20. data/locale/ka/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  21. data/locale/ko/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  22. data/locale/pt_BR/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  23. data/locale/ru/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  24. data/locale/zh_CN/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  25. data/locale/zh_TW/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  26. data/test/functional/associating_commands_test.rb +2 -2
  27. data/test/functional/bookmark_test.rb +2 -2
  28. data/test/functional/commands/list_test.rb +4 -4
  29. data/test/functional/filter_test.rb +1 -1
  30. data/test/functional/location_test.rb +1 -1
  31. data/test/functional/media_test.rb +2 -2
  32. data/test/functional/report_template_test.rb +4 -4
  33. data/test/functional/settings_test.rb +1 -1
  34. data/test/functional/virtual_machine_test.rb +4 -4
  35. data/test/test_helper.rb +0 -1
  36. data/test/unit/api/interactive_basic_auth_test.rb +2 -2
  37. data/test/unit/api/oauth/oauth_authentication_code_grant_test.rb +2 -2
  38. data/test/unit/api/oauth/oauth_password_grant_test.rb +2 -2
  39. data/test/unit/api/session_authenticator_wrapper_test.rb +7 -7
  40. data/test/unit/architecture_test.rb +12 -12
  41. data/test/unit/audit_test.rb +6 -6
  42. data/test/unit/auth_source_external.rb +5 -5
  43. data/test/unit/auth_source_ldap_test.rb +12 -12
  44. data/test/unit/bookmark_test.rb +12 -12
  45. data/test/unit/commands_test.rb +9 -9
  46. data/test/unit/common_parameter_test.rb +10 -10
  47. data/test/unit/compute_profile_test.rb +12 -12
  48. data/test/unit/compute_resource_test.rb +18 -18
  49. data/test/unit/config_report_test.rb +7 -7
  50. data/test/unit/domain_test.rb +16 -16
  51. data/test/unit/exception_handler_test.rb +1 -1
  52. data/test/unit/external_usergroup_test.rb +15 -15
  53. data/test/unit/fact_test.rb +3 -3
  54. data/test/unit/filter_test.rb +18 -18
  55. data/test/unit/helpers/command.rb +33 -33
  56. data/test/unit/helpers/resource_disabled.rb +1 -1
  57. data/test/unit/host_test.rb +35 -35
  58. data/test/unit/hostgroup_test.rb +18 -18
  59. data/test/unit/id_resolver_test.rb +1 -1
  60. data/test/unit/image_test.rb +15 -15
  61. data/test/unit/location_test.rb +12 -12
  62. data/test/unit/mail_notification_test.rb +6 -6
  63. data/test/unit/media_test.rb +12 -12
  64. data/test/unit/model_test.rb +12 -12
  65. data/test/unit/operating_system_test.rb +16 -16
  66. data/test/unit/option_builders_test.rb +2 -2
  67. data/test/unit/organization_test.rb +12 -12
  68. data/test/unit/output/formatters_test.rb +4 -4
  69. data/test/unit/param_filters_test.rb +2 -2
  70. data/test/unit/partition_table_test.rb +14 -14
  71. data/test/unit/realm_test.rb +12 -12
  72. data/test/unit/role_test.rb +14 -14
  73. data/test/unit/settings_test.rb +5 -5
  74. data/test/unit/smart_proxy_test.rb +14 -14
  75. data/test/unit/subnet_test.rb +12 -12
  76. data/test/unit/template_test.rb +16 -16
  77. data/test/unit/user_test.rb +12 -12
  78. data/test/unit/usergroup_test.rb +12 -12
  79. metadata +24 -22
@@ -7,19 +7,19 @@ describe HammerCLIForeman::Medium do
7
7
 
8
8
  include CommandTestHelper
9
9
 
10
- context "ListCommand" do
10
+ describe "ListCommand" do
11
11
  before do
12
12
  ResourceMocks.mock_action_call(:media, :index, [])
13
13
  end
14
14
 
15
15
  let(:cmd) { HammerCLIForeman::Medium::ListCommand.new("", ctx) }
16
16
 
17
- context "parameters" do
17
+ describe "parameters" do
18
18
  it_should_accept "no arguments"
19
19
  it_should_accept_search_params
20
20
  end
21
21
 
22
- context "output" do
22
+ describe "output" do
23
23
  let(:expected_record_count) { count_records(cmd.resource.call(:index)) }
24
24
 
25
25
  it_should_print_n_records
@@ -30,17 +30,17 @@ describe HammerCLIForeman::Medium do
30
30
 
31
31
  end
32
32
 
33
- context "InfoCommand" do
33
+ describe "InfoCommand" do
34
34
 
35
35
  let(:cmd) { HammerCLIForeman::Medium::InfoCommand.new("", ctx) }
36
36
 
37
- context "parameters" do
37
+ describe "parameters" do
38
38
  it_should_accept "id", ["--id=1"]
39
39
  it_should_accept "name", ["--name=medium_x"]
40
40
  # it_should_fail_with "no arguments" # TODO: temporarily disabled, parameters are checked in the id resolver
41
41
  end
42
42
 
43
- context "output" do
43
+ describe "output" do
44
44
  with_params ["--id=1"] do
45
45
  it_should_print_n_records 1
46
46
  it_should_print_column "Name"
@@ -54,11 +54,11 @@ describe HammerCLIForeman::Medium do
54
54
  end
55
55
  end
56
56
 
57
- context "CreateCommand" do
57
+ describe "CreateCommand" do
58
58
 
59
59
  let(:cmd) { HammerCLIForeman::Medium::CreateCommand.new("", ctx) }
60
60
 
61
- context "parameters" do
61
+ describe "parameters" do
62
62
  it_should_accept "name, path, os ids", ["--name=media", "--path=http://some.path/abc/$major/Fedora/$arch/", "--operatingsystem-ids=1,2"]
63
63
  # it_should_fail_with "name missing", ["--path=http://some.path/abc/$major/Fedora/$arch/"]
64
64
  # it_should_fail_with "path missing", ["--name=media"]
@@ -70,22 +70,22 @@ describe HammerCLIForeman::Medium do
70
70
  end
71
71
  end
72
72
 
73
- context "DeleteCommand" do
73
+ describe "DeleteCommand" do
74
74
 
75
75
  let(:cmd) { HammerCLIForeman::Medium::DeleteCommand.new("", ctx) }
76
76
 
77
- context "parameters" do
77
+ describe "parameters" do
78
78
  it_should_accept "name", ["--name=media"]
79
79
  it_should_accept "id", ["--id=1"]
80
80
  # it_should_fail_with "name or id missing", [] # TODO: temporarily disabled, parameters are checked in the id resolver
81
81
  end
82
82
  end
83
83
 
84
- context "UpdateCommand" do
84
+ describe "UpdateCommand" do
85
85
 
86
86
  let(:cmd) { HammerCLIForeman::Medium::UpdateCommand.new("", ctx) }
87
87
 
88
- context "parameters" do
88
+ describe "parameters" do
89
89
  it_should_accept "name", ["--name=medium"]
90
90
  it_should_accept "id", ["--id=1"]
91
91
  it_should_accept "os ids", ["--id=1", "--operatingsystem-ids=1,2"]
@@ -8,21 +8,21 @@ describe HammerCLIForeman::Model do
8
8
 
9
9
  include CommandTestHelper
10
10
 
11
- context 'ListCommand' do
11
+ describe 'ListCommand' do
12
12
  before do
13
13
  ResourceMocks.mock_action_call(:models, :index, [])
14
14
  end
15
15
 
16
16
  let(:cmd) { HammerCLIForeman::Model::ListCommand.new('', ctx) }
17
17
 
18
- context 'parameters' do
18
+ describe 'parameters' do
19
19
  it_should_accept 'no arguments'
20
20
  it_should_accept_search_params
21
21
  it_should_accept 'organization', ['--organization-id=1']
22
22
  it_should_accept 'location', ['--location-id=1']
23
23
  end
24
24
 
25
- context 'output' do
25
+ describe 'output' do
26
26
  let(:expected_record_count) { count_records(cmd.resource.call(:index)) }
27
27
 
28
28
  it_should_print_n_records
@@ -34,11 +34,11 @@ describe HammerCLIForeman::Model do
34
34
  end
35
35
 
36
36
 
37
- context 'InfoCommand' do
37
+ describe 'InfoCommand' do
38
38
 
39
39
  let(:cmd) { HammerCLIForeman::Model::InfoCommand.new('', ctx) }
40
40
 
41
- context 'parameters' do
41
+ describe 'parameters' do
42
42
  it_should_accept 'id', ['--id=1']
43
43
  it_should_accept 'name', ['--name=model']
44
44
  it_should_accept 'organization', %w[--id=1 --organization-id=1]
@@ -46,7 +46,7 @@ describe HammerCLIForeman::Model do
46
46
  # it_should_fail_with "no arguments" # TODO: temporarily disabled, parameters are checked in the id resolver
47
47
  end
48
48
 
49
- context 'output' do
49
+ describe 'output' do
50
50
  with_params ['--id=1'] do
51
51
  it_should_print_n_records 1
52
52
  it_should_print_column 'Name'
@@ -62,11 +62,11 @@ describe HammerCLIForeman::Model do
62
62
  end
63
63
 
64
64
 
65
- context 'CreateCommand' do
65
+ describe 'CreateCommand' do
66
66
 
67
67
  let(:cmd) { HammerCLIForeman::Model::CreateCommand.new('', ctx) }
68
68
 
69
- context 'parameters' do
69
+ describe 'parameters' do
70
70
  it_should_accept 'name, info, vendor-class, hardware-model, organization, location',
71
71
  %w[--name=model --info=description --vendor-class=class --hardware-model=model --organization-id=1 --location-id=1]
72
72
  # it_should_fail_with "name missing", ["--info=description", "--vendor-class=class", "--hardware-model=model"]
@@ -76,11 +76,11 @@ describe HammerCLIForeman::Model do
76
76
  end
77
77
 
78
78
 
79
- context 'DeleteCommand' do
79
+ describe 'DeleteCommand' do
80
80
 
81
81
  let(:cmd) { HammerCLIForeman::Model::DeleteCommand.new('', ctx) }
82
82
 
83
- context 'parameters' do
83
+ describe 'parameters' do
84
84
  it_should_accept 'name', ['--name=model']
85
85
  it_should_accept 'id', ['--id=1']
86
86
  it_should_accept 'organization', %w[--id=1 --organization-id=1]
@@ -91,11 +91,11 @@ describe HammerCLIForeman::Model do
91
91
  end
92
92
 
93
93
 
94
- context 'UpdateCommand' do
94
+ describe 'UpdateCommand' do
95
95
 
96
96
  let(:cmd) { HammerCLIForeman::Model::UpdateCommand.new('', ctx) }
97
97
 
98
- context 'parameters' do
98
+ describe 'parameters' do
99
99
  it_should_accept 'name', ['--name=model', '--new-name=model2', '--info=description', '--vendor-class=class', '--hardware-model=model']
100
100
  it_should_accept 'id', ['--id=1', '--new-name=model2', '--info=description', '--vendor-class=class', '--hardware-model=model']
101
101
  it_should_accept 'organization', %w[--id=1 --organization-id=1]
@@ -7,7 +7,7 @@ describe HammerCLIForeman::OperatingSystem do
7
7
 
8
8
  include CommandTestHelper
9
9
 
10
- context "ListCommand" do
10
+ describe "ListCommand" do
11
11
 
12
12
  before :each do
13
13
  ResourceMocks.operatingsystems
@@ -15,14 +15,14 @@ describe HammerCLIForeman::OperatingSystem do
15
15
 
16
16
  let(:cmd) { HammerCLIForeman::OperatingSystem::ListCommand.new("", ctx) }
17
17
 
18
- context "parameters" do
18
+ describe "parameters" do
19
19
  it_should_accept "no arguments"
20
20
  it_should_accept_search_params
21
21
  it_should_accept 'organization', ['--organization-id=1']
22
22
  it_should_accept 'location', ['--location-id=1']
23
23
  end
24
24
 
25
- context "output" do
25
+ describe "output" do
26
26
  let(:expected_record_count) { count_records(cmd.resource.call(:index)) }
27
27
 
28
28
  it_should_print_n_records
@@ -35,11 +35,11 @@ describe HammerCLIForeman::OperatingSystem do
35
35
  end
36
36
 
37
37
 
38
- context "InfoCommand" do
38
+ describe "InfoCommand" do
39
39
 
40
40
  let(:cmd) { HammerCLIForeman::OperatingSystem::InfoCommand.new("", ctx) }
41
41
 
42
- context "parameters" do
42
+ describe "parameters" do
43
43
  it_should_accept "id", ["--id=1"]
44
44
  it_should_accept "title", ["--title=Rhel 6.5"]
45
45
  it_should_accept 'organization', %w[--id=1 --organization-id=1]
@@ -47,7 +47,7 @@ describe HammerCLIForeman::OperatingSystem do
47
47
  # it_should_fail_with "no arguments" # TODO: temporarily disabled, parameters are checked in the id resolver
48
48
  end
49
49
 
50
- context "output" do
50
+ describe "output" do
51
51
  with_params ["--id=1"] do
52
52
  it_should_print_n_records 1
53
53
  it_should_print_column "Name"
@@ -68,11 +68,11 @@ describe HammerCLIForeman::OperatingSystem do
68
68
  end
69
69
 
70
70
 
71
- context "CreateCommand" do
71
+ describe "CreateCommand" do
72
72
 
73
73
  let(:cmd) { HammerCLIForeman::OperatingSystem::CreateCommand.new("", ctx) }
74
74
 
75
- context "parameters" do
75
+ describe "parameters" do
76
76
  it_should_accept "name, major, minor, family, release name, organization, location",
77
77
  ["--name=media", "--major=1", "--minor=2", "--family=Red Hat", "--release-name=awesome", "--organization-id=1", "--location-id=1"]
78
78
  # it_should_fail_with "name missing", ["--major=1", "--minor=2", "--family=Red Hat", "--release-name=awesome"]
@@ -85,11 +85,11 @@ describe HammerCLIForeman::OperatingSystem do
85
85
  end
86
86
 
87
87
 
88
- context "DeleteCommand" do
88
+ describe "DeleteCommand" do
89
89
 
90
90
  let(:cmd) { HammerCLIForeman::OperatingSystem::DeleteCommand.new("", ctx) }
91
91
 
92
- context "parameters" do
92
+ describe "parameters" do
93
93
  it_should_accept "id", ["--id=1"]
94
94
  it_should_accept "title", ["--title=Rhel 6.5"]
95
95
  it_should_accept 'organization', %w[--id=1 --organization-id=1]
@@ -101,11 +101,11 @@ describe HammerCLIForeman::OperatingSystem do
101
101
  end
102
102
 
103
103
 
104
- context "UpdateCommand" do
104
+ describe "UpdateCommand" do
105
105
 
106
106
  let(:cmd) { HammerCLIForeman::OperatingSystem::UpdateCommand.new("", ctx) }
107
107
 
108
- context "parameters" do
108
+ describe "parameters" do
109
109
  it_should_accept "id", ["--id=1"]
110
110
  it_should_accept "title", ["--title=Rhel 6.5"]
111
111
  it_should_accept "name, major, minor, family, release name, organization, location",
@@ -122,7 +122,7 @@ describe HammerCLIForeman::OperatingSystem do
122
122
  end
123
123
 
124
124
 
125
- context "SetParameterCommand" do
125
+ describe "SetParameterCommand" do
126
126
 
127
127
  before :each do
128
128
  ResourceMocks.operatingsystems
@@ -130,7 +130,7 @@ describe HammerCLIForeman::OperatingSystem do
130
130
 
131
131
  let(:cmd) { HammerCLIForeman::OperatingSystem::SetParameterCommand.new("", ctx) }
132
132
 
133
- context "parameters" do
133
+ describe "parameters" do
134
134
  it_should_accept "name, value and os id", ["--name=domain", "--value=val", "--operatingsystem-id=1"]
135
135
  it_should_accept "name, value and os title", ["--name=domain", "--value=val", "--operatingsystem=Rhel 6.5"]
136
136
  it_should_accept "name, value, type and os id", ["--name=domain", "--value=val", "--parameter-type=string", "--operatingsystem-id=1"]
@@ -143,11 +143,11 @@ describe HammerCLIForeman::OperatingSystem do
143
143
  end
144
144
 
145
145
 
146
- context "DeleteParameterCommand" do
146
+ describe "DeleteParameterCommand" do
147
147
 
148
148
  let(:cmd) { HammerCLIForeman::OperatingSystem::DeleteParameterCommand.new("", ctx) }
149
149
 
150
- context "parameters" do
150
+ describe "parameters" do
151
151
  it_should_accept "name and os id", ["--name=domain", "--operatingsystem-id=1"]
152
152
  it_should_accept "name and os title", ["--name=domain", "--operatingsystem=Rhel 6.5"]
153
153
  # it_should_fail_with "name missing", ["--operatingsystem-id=id"]
@@ -175,7 +175,7 @@ describe HammerCLIForeman::ForemanOptionBuilder do
175
175
  end
176
176
 
177
177
 
178
- context "primary searchables options expansion" do
178
+ describe "primary searchables options expansion" do
179
179
  let(:option_switches) { container.build(@build_options).map(&:switches) }
180
180
 
181
181
  it "can remove original searchable builder" do
@@ -208,7 +208,7 @@ describe HammerCLIForeman::ForemanOptionBuilder do
208
208
 
209
209
  end
210
210
 
211
- context "dependent searchables options expansion" do
211
+ describe "dependent searchables options expansion" do
212
212
  let(:option_switches) do
213
213
  container.build(@build_options.merge(command: Class.new(HammerCLIForeman::Command))).map(&:switches)
214
214
  end
@@ -9,7 +9,7 @@ describe HammerCLIForeman::Organization do
9
9
  include CommandTestHelper
10
10
  extend ResourceDisabled
11
11
 
12
- context "ListCommand" do
12
+ describe "ListCommand" do
13
13
 
14
14
  before :each do
15
15
  ResourceMocks.organizations_index
@@ -17,12 +17,12 @@ describe HammerCLIForeman::Organization do
17
17
 
18
18
  let(:cmd) { HammerCLIForeman::Organization::ListCommand.new("", ctx) }
19
19
 
20
- context "parameters" do
20
+ describe "parameters" do
21
21
  it_should_accept "no arguments"
22
22
  it_should_accept_search_params
23
23
  end
24
24
 
25
- context "output" do
25
+ describe "output" do
26
26
  let(:expected_record_count) { count_records(cmd.resource.call(:index)) }
27
27
 
28
28
  it_should_print_n_records
@@ -35,7 +35,7 @@ describe HammerCLIForeman::Organization do
35
35
  end
36
36
 
37
37
 
38
- context "InfoCommand" do
38
+ describe "InfoCommand" do
39
39
 
40
40
  before :each do
41
41
  ResourceMocks.organizations_show
@@ -43,13 +43,13 @@ describe HammerCLIForeman::Organization do
43
43
 
44
44
  let(:cmd) { HammerCLIForeman::Organization::InfoCommand.new("", ctx) }
45
45
 
46
- context "parameters" do
46
+ describe "parameters" do
47
47
  it_should_accept "id", ["--id=1"]
48
48
  it_should_accept "name", ["--name=arch"]
49
49
  # it_should_fail_with "no arguments" # TODO: temporarily disabled, parameters are checked in the id resolver
50
50
  end
51
51
 
52
- context "output" do
52
+ describe "output" do
53
53
  with_params ["--id=1"] do
54
54
  it_should_print_n_records 1
55
55
  it_should_print_column "Name"
@@ -66,11 +66,11 @@ describe HammerCLIForeman::Organization do
66
66
  end
67
67
 
68
68
 
69
- context "CreateCommand" do
69
+ describe "CreateCommand" do
70
70
 
71
71
  let(:cmd) { HammerCLIForeman::Organization::CreateCommand.new("", ctx) }
72
72
 
73
- context "parameters" do
73
+ describe "parameters" do
74
74
  it_should_accept "name", ["--name=org"]
75
75
  # it_should_fail_with "name missing", []
76
76
  # TODO: temporarily disabled, parameters are checked in the api
@@ -82,11 +82,11 @@ describe HammerCLIForeman::Organization do
82
82
  end
83
83
 
84
84
 
85
- context "DeleteCommand" do
85
+ describe "DeleteCommand" do
86
86
 
87
87
  let(:cmd) { HammerCLIForeman::Organization::DeleteCommand.new("", ctx) }
88
88
 
89
- context "parameters" do
89
+ describe "parameters" do
90
90
  it_should_accept "name", ["--name=org"]
91
91
  it_should_accept "id", ["--id=1"]
92
92
 
@@ -100,11 +100,11 @@ describe HammerCLIForeman::Organization do
100
100
  end
101
101
 
102
102
 
103
- context "UpdateCommand" do
103
+ describe "UpdateCommand" do
104
104
 
105
105
  let(:cmd) { HammerCLIForeman::Organization::UpdateCommand.new("", ctx) }
106
106
 
107
- context "parameters" do
107
+ describe "parameters" do
108
108
  it_should_accept "name", ["--name=org", "--new-name=org2"]
109
109
  it_should_accept "id", ["--id=1", "--new-name=org2"]
110
110
  # it_should_fail_with "no params", [] # TODO: temporarily disabled, parameters are checked in the id resolver
@@ -16,7 +16,7 @@ describe HammerCLIForeman::Output::Formatters::StructuredReferenceFormatter do
16
16
  end
17
17
  end
18
18
 
19
- context 'with symbol keys' do
19
+ describe 'with symbol keys' do
20
20
  it 'formats name' do
21
21
  options = {:display_field_key => :server_name}
22
22
  _(formatter.format(reference, options)).must_equal('Name' => "#{reference_str_keys['server_name']}")
@@ -30,7 +30,7 @@ describe HammerCLIForeman::Output::Formatters::StructuredReferenceFormatter do
30
30
  end
31
31
  end
32
32
 
33
- context 'with string keys' do
33
+ describe 'with string keys' do
34
34
  it 'formats name' do
35
35
  options = {:display_field_key => :server_name}
36
36
  _(formatter.format(reference_str_keys, options)).must_equal('Name' => "#{reference_str_keys['server_name']}")
@@ -62,7 +62,7 @@ describe HammerCLIForeman::Output::Formatters::ReferenceFormatter do
62
62
  _(formatter.format(nil)).must_equal ''
63
63
  end
64
64
 
65
- context 'with symbol keys' do
65
+ describe 'with symbol keys' do
66
66
  let(:reference_sym_keys) do
67
67
  reference
68
68
  end
@@ -106,7 +106,7 @@ describe HammerCLIForeman::Output::Formatters::ReferenceFormatter do
106
106
  end
107
107
  end
108
108
 
109
- context 'with string keys' do
109
+ describe 'with string keys' do
110
110
  let(:reference_str_keys) do
111
111
  reference.inject({}) do |new_ref, (key, value)|
112
112
  new_ref.update(key.to_s => value)
@@ -74,7 +74,7 @@ describe HammerCLIForeman::IdParamsFilter do
74
74
  _(filter.for_action(action)).must_equal required_params
75
75
  end
76
76
 
77
- context "with hash params" do
77
+ describe "with hash params" do
78
78
 
79
79
  let(:action) {
80
80
  stub(:params => [hash_param])
@@ -139,7 +139,7 @@ describe HammerCLIForeman::IdArrayParamsFilter do
139
139
  _(filter.for_action(action)).must_equal required_params
140
140
  end
141
141
 
142
- context "with hash params" do
142
+ describe "with hash params" do
143
143
 
144
144
  let(:action) {
145
145
  stub(:params => [hash_param])
@@ -14,19 +14,19 @@ describe HammerCLIForeman::PartitionTable do
14
14
  ::File.stubs(:read).returns("FILE_CONTENT")
15
15
  end
16
16
 
17
- context "ListCommand" do
17
+ describe "ListCommand" do
18
18
  before do
19
19
  ResourceMocks.mock_action_call(:ptables, :index, [])
20
20
  end
21
21
 
22
22
  let(:cmd) { HammerCLIForeman::PartitionTable::ListCommand.new("", ctx) }
23
23
 
24
- context "parameters" do
24
+ describe "parameters" do
25
25
  it_should_accept "no arguments"
26
26
  it_should_accept_search_params
27
27
  end
28
28
 
29
- context "output" do
29
+ describe "output" do
30
30
  let(:expected_record_count) { count_records(cmd.resource.call(:index)) }
31
31
 
32
32
  it_should_print_n_records
@@ -36,18 +36,18 @@ describe HammerCLIForeman::PartitionTable do
36
36
  end
37
37
 
38
38
 
39
- context "InfoCommand" do
39
+ describe "InfoCommand" do
40
40
 
41
41
  let(:cmd) { HammerCLIForeman::PartitionTable::InfoCommand.new("", ctx) }
42
42
 
43
- context "parameters" do
43
+ describe "parameters" do
44
44
  it_should_accept "id", ["--id=1"]
45
45
  it_should_accept "name", ["--name=ptable"]
46
46
 
47
47
  # it_should_fail_with "no arguments" # TODO: temporarily disabled, parameters are checked in the id resolver
48
48
  end
49
49
 
50
- context "output" do
50
+ describe "output" do
51
51
  with_params ["--id=1"] do
52
52
  it_should_print_n_records 1
53
53
  it_should_print_columns ["Id", "Name", "OS Family", "Created at", "Updated at"]
@@ -65,11 +65,11 @@ describe HammerCLIForeman::PartitionTable do
65
65
  end
66
66
 
67
67
 
68
- context "DumpCommand" do
68
+ describe "DumpCommand" do
69
69
 
70
70
  let(:cmd) { HammerCLIForeman::PartitionTable::DumpCommand.new("", ctx) }
71
71
 
72
- context "parameters" do
72
+ describe "parameters" do
73
73
  it_should_accept "id", ["--id=1"]
74
74
  it_should_accept "name", ["--name=ptable"]
75
75
  # it_should_fail_with "id or name missing", [] # TODO: temporarily disabled, parameters are checked in the id resolver
@@ -86,7 +86,7 @@ describe HammerCLIForeman::PartitionTable do
86
86
  end
87
87
 
88
88
 
89
- context "CreateCommand" do
89
+ describe "CreateCommand" do
90
90
 
91
91
  let(:cmd) { HammerCLIForeman::PartitionTable::CreateCommand.new("", ctx) }
92
92
 
@@ -94,7 +94,7 @@ describe HammerCLIForeman::PartitionTable do
94
94
  cmd.stubs(:template_kind_id).returns(1)
95
95
  end
96
96
 
97
- context "parameters" do
97
+ describe "parameters" do
98
98
  it_should_accept "name, file, os family", ["--name=tpl", "--file=~/table.sh", "--os-family=RedHat"]
99
99
  # it_should_fail_with "name missing", ["--file=~/table.sh", "--os-family=RedHat"]
100
100
  # it_should_fail_with "file missing", ["--name=tpl", "--os-family=RedHat"]
@@ -108,11 +108,11 @@ describe HammerCLIForeman::PartitionTable do
108
108
  end
109
109
 
110
110
 
111
- context "UpdateCommand" do
111
+ describe "UpdateCommand" do
112
112
 
113
113
  let(:cmd) { HammerCLIForeman::PartitionTable::UpdateCommand.new("", ctx) }
114
114
 
115
- context "parameters" do
115
+ describe "parameters" do
116
116
  it_should_accept "id, new-name, file, type, audit comment, os ids", ["--id=83", "--new-name=ptable","--file=~/table.sh", "--os-family=RedHat"]
117
117
  it_should_accept "name, new-name, file, type, audit comment, os ids", ["--name=ptable", "--new-name=ptable2", "--file=~/table.sh", "--os-family=RedHat"]
118
118
  # it_should_fail_with "id and name missing", ["--new-name=ptable","--file=~/table.sh", "--os-family=RedHat"]
@@ -126,11 +126,11 @@ describe HammerCLIForeman::PartitionTable do
126
126
  end
127
127
 
128
128
 
129
- context "DeleteCommand" do
129
+ describe "DeleteCommand" do
130
130
 
131
131
  let(:cmd) { HammerCLIForeman::PartitionTable::DeleteCommand.new("", ctx) }
132
132
 
133
- context "parameters" do
133
+ describe "parameters" do
134
134
  it_should_accept "id", ["--id=1"]
135
135
  it_should_accept "name", ["--name=ptable"]
136
136
  # it_should_fail_with "id or name missing", [] # TODO: temporarily disabled, parameters are checked in the id resolver
@@ -7,19 +7,19 @@ describe HammerCLIForeman::Realm do
7
7
 
8
8
  include CommandTestHelper
9
9
 
10
- context "ListCommand" do
10
+ describe "ListCommand" do
11
11
  before do
12
12
  ResourceMocks.mock_action_call(:realms, :index, [])
13
13
  end
14
14
 
15
15
  let(:cmd) { HammerCLIForeman::Realm::ListCommand.new("", ctx) }
16
16
 
17
- context "parameters" do
17
+ describe "parameters" do
18
18
  it_should_accept "no arguments"
19
19
  it_should_accept_search_params
20
20
  end
21
21
 
22
- context "output" do
22
+ describe "output" do
23
23
  let(:expected_record_count) { count_records(cmd.resource.call(:index)) }
24
24
 
25
25
  it_should_print_n_records
@@ -29,17 +29,17 @@ describe HammerCLIForeman::Realm do
29
29
  end
30
30
 
31
31
 
32
- context "InfoCommand" do
32
+ describe "InfoCommand" do
33
33
 
34
34
  let(:cmd) { HammerCLIForeman::Realm::InfoCommand.new("", ctx) }
35
35
 
36
- context "parameters" do
36
+ describe "parameters" do
37
37
  it_should_accept "id", ["--id=1"]
38
38
  it_should_accept "name", ["--name=arch"]
39
39
  # it_should_fail_with "no arguments" # TODO: temporarily disabled, parameters are checked in the id resolver
40
40
  end
41
41
 
42
- context "output" do
42
+ describe "output" do
43
43
  with_params ["--id=1"] do
44
44
  it_should_print_n_records 1
45
45
  it_should_print_columns ["Id", "Name", "Created at", "Updated at"]
@@ -49,22 +49,22 @@ describe HammerCLIForeman::Realm do
49
49
 
50
50
  end
51
51
 
52
- context "CreateCommand" do
52
+ describe "CreateCommand" do
53
53
 
54
54
  let(:cmd) { HammerCLIForeman::Realm::CreateCommand.new("", ctx) }
55
55
 
56
- context "parameters" do
56
+ describe "parameters" do
57
57
  it_should_accept "name, type, proxy", ["--name=realm", "--realm-type=FreeIPA", "--realm-proxy-id=1"]
58
58
  end
59
59
 
60
60
  end
61
61
 
62
62
 
63
- context "DeleteCommand" do
63
+ describe "DeleteCommand" do
64
64
 
65
65
  let(:cmd) { HammerCLIForeman::Realm::DeleteCommand.new("", ctx) }
66
66
 
67
- context "parameters" do
67
+ describe "parameters" do
68
68
  it_should_accept "name", ["--name=realm"]
69
69
  it_should_accept "id", ["--id=1"]
70
70
  # it_should_fail_with "name or id missing", [] # TODO: temporarily disabled, parameters are checked in the id resolver
@@ -73,11 +73,11 @@ describe HammerCLIForeman::Realm do
73
73
  end
74
74
 
75
75
 
76
- context "UpdateCommand" do
76
+ describe "UpdateCommand" do
77
77
 
78
78
  let(:cmd) { HammerCLIForeman::Realm::UpdateCommand.new("", ctx) }
79
79
 
80
- context "parameters" do
80
+ describe "parameters" do
81
81
  it_should_accept "name", ["--name=realm", "--new-name=realm2"]
82
82
  it_should_accept "id", ["--id=1", "--new-name=realm2"]
83
83
  # it_should_fail_with "no params", []