diff options
author | Tim Smith <tsmith@chef.io> | 2017-12-07 11:47:18 -0800 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2017-12-07 13:27:30 -0800 |
commit | 6cf225b7e4b9e3cb788e3998d4c54f32e55ea9df (patch) | |
tree | 2413c43d39359870c8d824cd951ad99f9d700ac9 /spec | |
parent | 6ad0ac95c33969a16b79fd32cd987fe68c150266 (diff) | |
download | chef-6cf225b7e4b9e3cb788e3998d4c54f32e55ea9df.tar.gz |
Improve the integer/string warning message
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/functional/resource/windows_task_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/resource/windows_task_spec.rb | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/spec/functional/resource/windows_task_spec.rb b/spec/functional/resource/windows_task_spec.rb index b6e6540693..b9aa6c6568 100644 --- a/spec/functional/resource/windows_task_spec.rb +++ b/spec/functional/resource/windows_task_spec.rb @@ -308,7 +308,7 @@ describe Chef::Resource::WindowsTask, :windows_only do it "raises error if invalid random_delay is passed" do subject.frequency :minute subject.random_delay "abc" - expect { subject.after_created }.to raise_error("Invalid value passed for `random_delay`. Please pass seconds as a String e.g. '60'.") + expect { subject.after_created }.to raise_error("Invalid value passed for `random_delay`. Please pass seconds as an Integer (e.g. 60) or a String with numeric values only (e.g. '60').") end it "raises error if random_delay is passed with frequency on_idle" do diff --git a/spec/unit/resource/windows_task_spec.rb b/spec/unit/resource/windows_task_spec.rb index 725aa0fd86..21de8c6fb6 100644 --- a/spec/unit/resource/windows_task_spec.rb +++ b/spec/unit/resource/windows_task_spec.rb @@ -89,13 +89,13 @@ describe Chef::Resource::WindowsTask do it "raises error for invalid random_delay" do resource.frequency :monthly resource.random_delay "xyz" - expect { resource.after_created }.to raise_error(Chef::Exceptions::ArgumentError, "Invalid value passed for `random_delay`. Please pass seconds an Integer or a String with numeric values only e.g. '60'.") + expect { resource.after_created }.to raise_error(Chef::Exceptions::ArgumentError, "Invalid value passed for `random_delay`. Please pass seconds as an Integer (e.g. 60) or a String with numeric values only (e.g. '60').") end it "raises error for invalid random_delay which looks like an Integer" do resource.frequency :monthly resource.random_delay "5,000" - expect { resource.after_created }.to raise_error(Chef::Exceptions::ArgumentError, "Invalid value passed for `random_delay`. Please pass seconds an Integer or a String with numeric values only e.g. '60'.") + expect { resource.after_created }.to raise_error(Chef::Exceptions::ArgumentError, "Invalid value passed for `random_delay`. Please pass seconds as an Integer (e.g. 60) or a String with numeric values only (e.g. '60').") end it "converts seconds String into iso8601 duration format" do @@ -123,12 +123,12 @@ describe Chef::Resource::WindowsTask do context "when execution_time_limit is passed" do it "raises error for invalid execution_time_limit" do resource.execution_time_limit "abc" - expect { resource.after_created }.to raise_error(Chef::Exceptions::ArgumentError, "Invalid value passed for `execution_time_limit`. Please pass seconds an Integer or a String with numeric values only e.g. '60'.") + expect { resource.after_created }.to raise_error(Chef::Exceptions::ArgumentError, "Invalid value passed for `execution_time_limit`. Please pass seconds as an Integer (e.g. 60) or a String with numeric values only (e.g. '60').") end it "raises error for invalid execution_time_limit that looks like an Integer" do resource.execution_time_limit "5,000" - expect { resource.after_created }.to raise_error(Chef::Exceptions::ArgumentError, "Invalid value passed for `execution_time_limit`. Please pass seconds an Integer or a String with numeric values only e.g. '60'.") + expect { resource.after_created }.to raise_error(Chef::Exceptions::ArgumentError, "Invalid value passed for `execution_time_limit`. Please pass seconds as an Integer (e.g. 60) or a String with numeric values only (e.g. '60').") end it "converts seconds Integer into iso8601 format" do |