hammer_cli 0.4.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/hammer +1 -1
- data/doc/release_notes.md +9 -0
- data/lib/hammer_cli/abstract.rb +14 -4
- data/lib/hammer_cli/context.rb +13 -0
- data/lib/hammer_cli/defaults.rb +83 -0
- data/lib/hammer_cli/defaults_commands.rb +160 -0
- data/lib/hammer_cli/options/option_definition.rb +3 -3
- data/lib/hammer_cli/output/adapter/json.rb +13 -0
- data/lib/hammer_cli/output/adapter/yaml.rb +13 -0
- data/lib/hammer_cli/settings.rb +1 -0
- data/lib/hammer_cli/version.rb +1 -1
- data/lib/hammer_cli.rb +2 -0
- data/locale/de/hammer-cli.edit.po +251 -139
- data/locale/de/hammer-cli.po +81 -7
- data/locale/en/hammer-cli.edit.po +95 -7
- data/locale/en/hammer-cli.po +79 -5
- data/locale/en_GB/hammer-cli.edit.po +248 -136
- data/locale/en_GB/hammer-cli.po +81 -7
- data/locale/es/hammer-cli.edit.po +250 -138
- data/locale/es/hammer-cli.po +81 -7
- data/locale/fr/hammer-cli.edit.po +250 -138
- data/locale/fr/hammer-cli.po +81 -7
- data/locale/hammer-cli.pot +104 -8
- data/locale/it/hammer-cli.edit.po +249 -137
- data/locale/it/hammer-cli.po +81 -7
- data/locale/ja/hammer-cli.edit.po +248 -136
- data/locale/ja/hammer-cli.po +81 -7
- data/locale/ko/hammer-cli.edit.po +248 -136
- data/locale/ko/hammer-cli.po +81 -7
- data/locale/pt_BR/hammer-cli.edit.po +250 -137
- data/locale/pt_BR/hammer-cli.po +81 -7
- data/locale/ru/hammer-cli.edit.po +249 -137
- data/locale/ru/hammer-cli.po +81 -7
- data/locale/zh_CN/hammer-cli.edit.po +248 -136
- data/locale/zh_CN/hammer-cli.po +82 -8
- data/locale/zh_TW/hammer-cli.edit.po +248 -136
- data/locale/zh_TW/hammer-cli.po +81 -7
- data/test/functional/defaults_test.rb +177 -0
- data/test/reports/TEST-Fields-ContainerField-display-.xml +1 -1
- data/test/reports/TEST-Fields-ContainerField-display-blank-is-allowed.xml +5 -5
- data/test/reports/TEST-Fields-ContainerField-display-blank-is-not-allowed.xml +5 -5
- data/test/reports/TEST-Fields-ContainerField.xml +1 -1
- data/test/reports/TEST-Fields-Field-display-.xml +1 -1
- data/test/reports/TEST-Fields-Field-display-blank-is-allowed.xml +3 -3
- data/test/reports/TEST-Fields-Field-display-blank-is-not-allowed.xml +3 -3
- data/test/reports/TEST-Fields-Field-hide-blank-.xml +3 -3
- data/test/reports/TEST-Fields-Field-parameters.xml +2 -2
- data/test/reports/TEST-Fields-Field.xml +4 -4
- data/test/reports/TEST-Fields-Label-display-.xml +7 -0
- data/test/reports/TEST-Fields-Label-display-blank-is-allowed.xml +15 -0
- data/test/reports/TEST-Fields-Label-display-blank-is-not-allowed.xml +15 -0
- data/test/reports/TEST-Fields-Label.xml +7 -0
- data/test/reports/TEST-HammerCLI-AbstractCommand-build-options.xml +5 -5
- data/test/reports/TEST-HammerCLI-AbstractCommand-exception-handler.xml +4 -4
- data/test/reports/TEST-HammerCLI-AbstractCommand-logging.xml +10 -8
- data/test/reports/TEST-HammerCLI-AbstractCommand-option-builder.xml +3 -3
- data/test/reports/TEST-HammerCLI-AbstractCommand-options.xml +3 -3
- data/test/reports/TEST-HammerCLI-AbstractCommand-output.xml +7 -7
- data/test/reports/TEST-HammerCLI-AbstractCommand-subcommand-behavior-remove-subcommand.xml +3 -3
- data/test/reports/TEST-HammerCLI-AbstractCommand-subcommand-behavior-subcommand-.xml +4 -4
- data/test/reports/TEST-HammerCLI-AbstractCommand-subcommand-behavior-subcommand.xml +3 -3
- data/test/reports/TEST-HammerCLI-AbstractCommand-subcommand-behavior.xml +1 -1
- data/test/reports/TEST-HammerCLI-AbstractCommand.xml +3 -3
- data/test/reports/TEST-HammerCLI-Apipie-Command-options.xml +3 -3
- data/test/reports/TEST-HammerCLI-Apipie-Command-reload-apipie-cache.xml +11 -0
- data/test/reports/TEST-HammerCLI-Apipie-Command-resource-defined.xml +2 -2
- data/test/reports/TEST-HammerCLI-Apipie-Command-setting-resources.xml +7 -7
- data/test/reports/TEST-HammerCLI-Apipie-Command.xml +2 -2
- data/test/reports/TEST-HammerCLI-Apipie-OptionBuilder-aliasing-resources.xml +4 -4
- data/test/reports/TEST-HammerCLI-Apipie-OptionBuilder-filtering-options.xml +5 -5
- data/test/reports/TEST-HammerCLI-Apipie-OptionBuilder-required-options.xml +3 -3
- data/test/reports/TEST-HammerCLI-Apipie-OptionBuilder-setting-correct-normalizers.xml +8 -2
- data/test/reports/TEST-HammerCLI-Apipie-OptionBuilder-setting-referenced-resources.xml +9 -0
- data/test/reports/TEST-HammerCLI-Apipie-OptionBuilder-with-hash-params.xml +3 -3
- data/test/reports/TEST-HammerCLI-Apipie-OptionBuilder-with-one-simple-param.xml +5 -5
- data/test/reports/TEST-HammerCLI-Apipie-OptionBuilder.xml +1 -1
- data/test/reports/TEST-HammerCLI-Apipie-OptionDefinition-referenced-resource.xml +13 -0
- data/test/reports/TEST-HammerCLI-Apipie-OptionDefinition.xml +7 -0
- data/test/reports/TEST-HammerCLI-Completer-command-completion.xml +12 -12
- data/test/reports/TEST-HammerCLI-Completer-option-value-completion.xml +6 -6
- data/test/reports/TEST-HammerCLI-Completer-subcommand-completion.xml +7 -7
- data/test/reports/TEST-HammerCLI-Completer.xml +1 -1
- data/test/reports/TEST-HammerCLI-CompleterLine-line-complete.xml +10 -10
- data/test/reports/TEST-HammerCLI-CompleterLine-splitting-words.xml +12 -12
- data/test/reports/TEST-HammerCLI-CompleterLine.xml +1 -1
- data/test/reports/TEST-HammerCLI-CompleterWord-complete-.xml +9 -9
- data/test/reports/TEST-HammerCLI-CompleterWord-quote.xml +5 -5
- data/test/reports/TEST-HammerCLI-CompleterWord-quoted-.xml +4 -4
- data/test/reports/TEST-HammerCLI-CompleterWord.xml +1 -1
- data/test/reports/TEST-HammerCLI-Connection.xml +8 -8
- data/test/reports/TEST-HammerCLI-Defaults.xml +19 -0
- data/test/reports/TEST-HammerCLI-ExceptionHandler.xml +8 -8
- data/test/reports/TEST-HammerCLI-I18n.xml +3 -3
- data/test/reports/TEST-HammerCLI-MainCommand-loading-context-password.xml +3 -3
- data/test/reports/TEST-HammerCLI-MainCommand-loading-context-username.xml +3 -3
- data/test/reports/TEST-HammerCLI-MainCommand-loading-context-verbose.xml +2 -2
- data/test/reports/TEST-HammerCLI-MainCommand-loading-context.xml +1 -1
- data/test/reports/TEST-HammerCLI-MainCommand.xml +1 -1
- data/test/reports/TEST-HammerCLI-Modules-find-by-name.xml +4 -4
- data/test/reports/TEST-HammerCLI-Modules-load-a-module-module-not-found.xml +4 -4
- data/test/reports/TEST-HammerCLI-Modules-load-a-module-module-runtime-exception.xml +4 -4
- data/test/reports/TEST-HammerCLI-Modules-load-a-module-success.xml +5 -5
- data/test/reports/TEST-HammerCLI-Modules-load-a-module.xml +1 -1
- data/test/reports/TEST-HammerCLI-Modules-load-all-modules.xml +4 -2
- data/test/reports/TEST-HammerCLI-Modules-names.xml +4 -4
- data/test/reports/TEST-HammerCLI-Modules.xml +1 -1
- data/test/reports/TEST-HammerCLI-OptionBuilderContainer.0.xml +5 -1
- data/test/reports/TEST-HammerCLI-OptionBuilderContainer.xml +1 -5
- data/test/reports/TEST-HammerCLI-Options-Matcher.xml +17 -0
- data/test/reports/TEST-HammerCLI-Options-Normalizers-abstract.xml +2 -2
- data/test/reports/TEST-HammerCLI-Options-Normalizers-bool.xml +13 -13
- data/test/reports/TEST-HammerCLI-Options-Normalizers-datetime.xml +6 -6
- data/test/reports/TEST-HammerCLI-Options-Normalizers-enum.xml +5 -5
- data/test/reports/TEST-HammerCLI-Options-Normalizers-enumlist.xml +8 -8
- data/test/reports/TEST-HammerCLI-Options-Normalizers-json-input.xml +5 -5
- data/test/reports/TEST-HammerCLI-Options-Normalizers-key-value-list.xml +26 -6
- data/test/reports/TEST-HammerCLI-Options-Normalizers-list.xml +5 -5
- data/test/reports/TEST-HammerCLI-Options-Normalizers-number.xml +11 -0
- data/test/reports/TEST-HammerCLI-Options-Normalizers.xml +1 -1
- data/test/reports/TEST-HammerCLI-Options-OptionDefinition-context.xml +2 -2
- data/test/reports/TEST-HammerCLI-Options-OptionDefinition-deprecated-options.xml +11 -0
- data/test/reports/TEST-HammerCLI-Options-OptionDefinition-formatters.xml +3 -3
- data/test/reports/TEST-HammerCLI-Options-OptionDefinition.xml +1 -1
- data/test/reports/TEST-HammerCLI-Output-Adapter-Abstract-error-messages.xml +5 -5
- data/test/reports/TEST-HammerCLI-Output-Adapter-Abstract-messages.xml +3 -3
- data/test/reports/TEST-HammerCLI-Output-Adapter-Abstract-test-data-for-field.xml +5 -5
- data/test/reports/TEST-HammerCLI-Output-Adapter-Abstract.xml +6 -6
- data/test/reports/TEST-HammerCLI-Output-Adapter-Base-print-collection-show-ids.xml +2 -2
- data/test/reports/TEST-HammerCLI-Output-Adapter-Base-print-collection.xml +11 -11
- data/test/reports/TEST-HammerCLI-Output-Adapter-Base.xml +1 -1
- data/test/reports/TEST-HammerCLI-Output-Adapter-CSValues-print-collection-formatters.xml +3 -3
- data/test/reports/TEST-HammerCLI-Output-Adapter-CSValues-print-collection-handle-fields-with-collections.xml +4 -4
- data/test/reports/TEST-HammerCLI-Output-Adapter-CSValues-print-collection-handle-fields-with-containers.xml +3 -3
- data/test/reports/TEST-HammerCLI-Output-Adapter-CSValues-print-collection-handle-ids.xml +3 -3
- data/test/reports/TEST-HammerCLI-Output-Adapter-CSValues-print-collection.xml +3 -3
- data/test/reports/TEST-HammerCLI-Output-Adapter-CSValues-print-message.xml +3 -3
- data/test/reports/TEST-HammerCLI-Output-Adapter-CSValues.xml +1 -1
- data/test/reports/TEST-HammerCLI-Output-Adapter-Json-print-collection-show-ids.xml +9 -0
- data/test/reports/TEST-HammerCLI-Output-Adapter-Json-print-collection.xml +27 -0
- data/test/reports/TEST-HammerCLI-Output-Adapter-Json-print-message.xml +11 -0
- data/test/reports/TEST-HammerCLI-Output-Adapter-Json.xml +7 -0
- data/test/reports/TEST-HammerCLI-Output-Adapter-Table-print-collection-column-width.xml +11 -5
- data/test/reports/TEST-HammerCLI-Output-Adapter-Table-print-collection-formatters.xml +3 -3
- data/test/reports/TEST-HammerCLI-Output-Adapter-Table-print-collection-handle-ids.xml +7 -3
- data/test/reports/TEST-HammerCLI-Output-Adapter-Table-print-collection-sort-columns.xml +2 -2
- data/test/reports/TEST-HammerCLI-Output-Adapter-Table-print-collection.xml +3 -3
- data/test/reports/TEST-HammerCLI-Output-Adapter-Table.xml +1 -1
- data/test/reports/TEST-HammerCLI-Output-Adapter-Yaml-print-collection-show-ids.xml +9 -0
- data/test/reports/TEST-HammerCLI-Output-Adapter-Yaml-print-collection.xml +27 -0
- data/test/reports/TEST-HammerCLI-Output-Adapter-Yaml-print-message.xml +11 -0
- data/test/reports/TEST-HammerCLI-Output-Adapter-Yaml.xml +7 -0
- data/test/reports/TEST-HammerCLI-Output-Definition-empty-.xml +3 -3
- data/test/reports/TEST-HammerCLI-Output-Definition.xml +3 -3
- data/test/reports/TEST-HammerCLI-Output-Dsl-collection.xml +4 -4
- data/test/reports/TEST-HammerCLI-Output-Dsl-custom-fields.xml +3 -3
- data/test/reports/TEST-HammerCLI-Output-Dsl-fields.xml +5 -5
- data/test/reports/TEST-HammerCLI-Output-Dsl-label.xml +4 -4
- data/test/reports/TEST-HammerCLI-Output-Dsl-path-definition.xml +4 -4
- data/test/reports/TEST-HammerCLI-Output-Dsl.xml +2 -2
- data/test/reports/TEST-HammerCLI-Output-FieldFilter.xml +4 -4
- data/test/reports/TEST-HammerCLI-Output-Formatters-BooleanFormatter.xml +3 -3
- data/test/reports/TEST-HammerCLI-Output-Formatters-ColorFormatter.xml +2 -2
- data/test/reports/TEST-HammerCLI-Output-Formatters-DateFormatter.xml +3 -3
- data/test/reports/TEST-HammerCLI-Output-Formatters-FieldFormatter.xml +4 -4
- data/test/reports/TEST-HammerCLI-Output-Formatters-FormatterContainer.xml +4 -4
- data/test/reports/TEST-HammerCLI-Output-Formatters-FormatterLibrary.xml +3 -3
- data/test/reports/TEST-HammerCLI-Output-Formatters-KeyValueFormatter.xml +4 -4
- data/test/reports/TEST-HammerCLI-Output-Formatters-ListFormatter.xml +4 -4
- data/test/reports/TEST-HammerCLI-Output-Formatters-LongTextFormatter.xml +4 -4
- data/test/reports/TEST-HammerCLI-Output-Output-adapters.xml +6 -6
- data/test/reports/TEST-HammerCLI-Output-Output-data.xml +5 -5
- data/test/reports/TEST-HammerCLI-Output-Output-formatters.xml +2 -2
- data/test/reports/TEST-HammerCLI-Output-Output-messages.xml +7 -7
- data/test/reports/TEST-HammerCLI-Output-Output.xml +1 -1
- data/test/reports/TEST-HammerCLI-Output-RecordCollection.xml +4 -4
- data/test/reports/TEST-HammerCLI-Settings-load-from-paths.xml +5 -5
- data/test/reports/TEST-HammerCLI-Settings.xml +10 -10
- data/test/reports/TEST-HammerCLI-ShellHistory-loading-old-history.xml +3 -3
- data/test/reports/TEST-HammerCLI-ShellHistory-saving-history.xml +5 -5
- data/test/reports/TEST-HammerCLI-ShellHistory.xml +1 -1
- data/test/reports/TEST-HammerCLI-constant-path.xml +15 -0
- data/test/reports/{TEST-String-interactive-.xml → TEST-HammerCLI-interactive-.xml} +4 -4
- data/test/reports/TEST-HammerCLI.xml +7 -0
- data/test/reports/TEST-Logging-LogEvent-filtering.xml +9 -0
- data/test/reports/TEST-Logging-LogEvent.xml +7 -0
- data/test/reports/TEST-MiniTest-Spec.xml +1 -1
- data/test/reports/TEST-String-camelize.xml +3 -3
- data/test/reports/TEST-String-constantize.xml +15 -0
- data/test/reports/TEST-String-formatting.xml +6 -6
- data/test/reports/TEST-String-indent.xml +3 -3
- data/test/reports/TEST-String-underscore.xml +13 -0
- data/test/reports/TEST-String.xml +1 -1
- data/test/reports/TEST-commands-defaults-add.xml +21 -0
- data/test/reports/TEST-commands-defaults-delete.xml +11 -0
- data/test/reports/TEST-commands-defaults-list.xml +11 -0
- data/test/reports/TEST-commands-defaults-providers.xml +11 -0
- data/test/reports/TEST-commands.xml +7 -0
- data/test/reports/TEST-constraints-HammerCLI-Validator-AllConstraint-exist-.xml +4 -4
- data/test/reports/TEST-constraints-HammerCLI-Validator-AllConstraint.xml +1 -1
- data/test/reports/TEST-constraints-HammerCLI-Validator-AnyConstraint-exist-.xml +4 -4
- data/test/reports/TEST-constraints-HammerCLI-Validator-AnyConstraint.xml +1 -1
- data/test/reports/TEST-constraints-HammerCLI-Validator-BaseConstraint-exist-.xml +2 -2
- data/test/reports/TEST-constraints-HammerCLI-Validator-BaseConstraint-rejected.xml +4 -4
- data/test/reports/TEST-constraints-HammerCLI-Validator-BaseConstraint-required.xml +4 -4
- data/test/reports/TEST-constraints-HammerCLI-Validator-BaseConstraint.xml +1 -1
- data/test/reports/TEST-constraints.xml +1 -1
- data/test/unit/apipie/command_test.rb +1 -0
- data/test/unit/defaults_test.rb +45 -0
- data/test/unit/fixtures/defaults/defaults.yml +6 -0
- data/test/unit/output/adapter/json_test.rb +30 -0
- data/test/unit/output/adapter/yaml_test.rb +28 -0
- metadata +258 -186
@@ -1,5 +1,5 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<testsuite name="constraints::HammerCLI::Validator::BaseConstraint" tests="0" time="0.
|
2
|
+
<testsuite name="constraints::HammerCLI::Validator::BaseConstraint" tests="0" time="0.000199675" failures="0" errors="0" skipped="0" assertions="0" timestamp="2015-12-10T23:59:29+00:00">
|
3
3
|
<system-out>
|
4
4
|
</system-out>
|
5
5
|
<system-err>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<testsuite name="constraints" tests="0" time="0.
|
2
|
+
<testsuite name="constraints" tests="0" time="0.000339576" failures="0" errors="0" skipped="0" assertions="0" timestamp="2015-12-10T23:59:29+00:00">
|
3
3
|
<system-out>
|
4
4
|
</system-out>
|
5
5
|
<system-err>
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'test_helper')
|
2
|
+
describe HammerCLI::Defaults do
|
3
|
+
|
4
|
+
FILEPATH = File.join(File.dirname(__FILE__), '/fixtures/defaults/defaults.yml')
|
5
|
+
|
6
|
+
before(:all) do
|
7
|
+
settings = YAML::load(File.open(FILEPATH))
|
8
|
+
|
9
|
+
@defaults = HammerCLI::Defaults.new(settings[:defaults], FILEPATH)
|
10
|
+
@defaults.stubs(:write_to_file).returns true
|
11
|
+
end
|
12
|
+
|
13
|
+
it "Should add a default param to defaults file, without a provider" do
|
14
|
+
defaults_result = @defaults.add_defaults_to_conf({"organization_id"=> 3}, nil)
|
15
|
+
assert_equal 3, defaults_result[:defaults][:organization_id][:value]
|
16
|
+
end
|
17
|
+
|
18
|
+
it "Should add a default param to defaults file, with provider" do
|
19
|
+
defaults_result = @defaults.add_defaults_to_conf({"location_id"=>nil}, :foreman)
|
20
|
+
assert_equal :foreman, defaults_result[:defaults][:location_id][:provider]
|
21
|
+
end
|
22
|
+
|
23
|
+
it "Should remove default param from defaults file" do
|
24
|
+
defaults_result = @defaults.delete_default_from_conf(:organization_id)
|
25
|
+
assert_nil defaults_result[:defaults][:organization_id]
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should get the default param, without provider" do
|
29
|
+
assert_equal 2, @defaults.get_defaults("location_id")
|
30
|
+
end
|
31
|
+
|
32
|
+
it "should get the default param, with provider" do
|
33
|
+
fake_provider = mock()
|
34
|
+
fake_provider.stubs(:provider_name).returns(:foreman)
|
35
|
+
fake_provider.expects(:get_defaults).with(:organization_id).returns(3)
|
36
|
+
@defaults.register_provider(fake_provider)
|
37
|
+
assert_equal 3, @defaults.get_defaults("organization_id")
|
38
|
+
end
|
39
|
+
|
40
|
+
it "should return empty defaults when the settings file is not present" do
|
41
|
+
defaults = HammerCLI::Defaults.new(nil, FILEPATH)
|
42
|
+
assert_equal({}, defaults.defaults_settings)
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
@@ -5,6 +5,36 @@ describe HammerCLI::Output::Adapter::Json do
|
|
5
5
|
let(:context) {{}}
|
6
6
|
let(:adapter) { HammerCLI::Output::Adapter::Json.new(context, HammerCLI::Output::Output.formatters) }
|
7
7
|
|
8
|
+
context "print_message" do
|
9
|
+
it "prints the message" do
|
10
|
+
params = { :a => 'Test', :b => 83 }
|
11
|
+
msg = "Rendered with %{a} and %{b}"
|
12
|
+
expected_output = [
|
13
|
+
'{',
|
14
|
+
' "message": "Rendered with Test and 83"',
|
15
|
+
'}',
|
16
|
+
''
|
17
|
+
].join("\n")
|
18
|
+
|
19
|
+
proc { adapter.print_message(msg, params) }.must_output(expected_output)
|
20
|
+
end
|
21
|
+
|
22
|
+
it "prints the message with name and id" do
|
23
|
+
params = { :name => 'Test', :id => 83 }
|
24
|
+
msg = "Rendered with %{name} and %{id}"
|
25
|
+
expected_output = [
|
26
|
+
'{',
|
27
|
+
' "message": "Rendered with Test and 83",',
|
28
|
+
' "id": 83,',
|
29
|
+
' "name": "Test"',
|
30
|
+
'}',
|
31
|
+
''
|
32
|
+
].join("\n")
|
33
|
+
|
34
|
+
proc { adapter.print_message(msg, params) }.must_output(expected_output)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
8
38
|
context "print_collection" do
|
9
39
|
|
10
40
|
let(:id) { Fields::Id.new(:path => [:id], :label => "Id") }
|
@@ -5,6 +5,34 @@ describe HammerCLI::Output::Adapter::Yaml do
|
|
5
5
|
let(:context) {{}}
|
6
6
|
let(:adapter) { HammerCLI::Output::Adapter::Yaml.new(context, HammerCLI::Output::Output.formatters) }
|
7
7
|
|
8
|
+
context "print_message" do
|
9
|
+
it "prints the message" do
|
10
|
+
params = { :a => 'Test', :b => 83 }
|
11
|
+
msg = "Rendered with %{a} and %{b}"
|
12
|
+
expected_output = [
|
13
|
+
'---',
|
14
|
+
':message: Rendered with Test and 83',
|
15
|
+
''
|
16
|
+
].join("\n")
|
17
|
+
|
18
|
+
proc { adapter.print_message(msg, params) }.must_output(expected_output)
|
19
|
+
end
|
20
|
+
|
21
|
+
it "prints the message with name and id" do
|
22
|
+
params = { :name => 'Test', :id => 83 }
|
23
|
+
msg = "Rendered with %{name} and %{id}"
|
24
|
+
expected_output = [
|
25
|
+
'---',
|
26
|
+
':message: Rendered with Test and 83',
|
27
|
+
':id: 83',
|
28
|
+
':name: Test',
|
29
|
+
''
|
30
|
+
].join("\n")
|
31
|
+
|
32
|
+
proc { adapter.print_message(msg, params) }.must_output(expected_output)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
8
36
|
context "print_collection" do
|
9
37
|
|
10
38
|
let(:id) { Fields::Id.new(:path => [:id], :label => "Id") }
|