diff options
author | vinay sharma <vinay.sharma@msystechnologies.com> | 2019-05-25 18:32:32 +0530 |
---|---|---|
committer | Bryan McLellan <btm@loftninjas.org> | 2019-05-25 06:02:32 -0700 |
commit | b09187f85157fad6a8f29f08c09a69eac3f0bee5 (patch) | |
tree | 6c1f773504cfd7bd93c44f97425a32e52d538a24 /spec/functional | |
parent | 34d511500a4d5c196417b09abfa83e9f33378052 (diff) | |
download | chef-b09187f85157fad6a8f29f08c09a69eac3f0bee5.tar.gz |
Fixed issue for chef-client run was throwing error when provided empty string with it (#8200)
* fixed issue for chef-client run was throwing error when provided empty string with it
Signed-off-by: vinay033 <vsharma@chef.io>
Diffstat (limited to 'spec/functional')
-rw-r--r-- | spec/functional/mixin/from_file_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/functional/mixin/from_file_spec.rb b/spec/functional/mixin/from_file_spec.rb index a279f48790..d8519b4185 100644 --- a/spec/functional/mixin/from_file_spec.rb +++ b/spec/functional/mixin/from_file_spec.rb @@ -21,6 +21,7 @@ describe Chef::Mixin::FromFile do REAL_DATA = File.join(CHEF_SPEC_DATA, "mixin", "real_data.rb") INVALID_DATA = File.join(CHEF_SPEC_DATA, "mixin", "invalid_data.rb") NO_DATA = File.join(CHEF_SPEC_DATA, "mixin", "non_existant_data.rb") + DIRECTORY = File.expand_path("") class TestData include Chef::Mixin::FromFile @@ -78,5 +79,15 @@ describe Chef::Mixin::FromFile do datum = TestData.new expect { datum.from_file(NO_DATA) }.to raise_error(IOError) end + + it "should fail if it's a directory not a file" do + datum = TestData.new + expect { datum.from_file(DIRECTORY) }.to raise_error(IOError) + end + + it "should fail class if it's a directory not a file" do + datum = ClassTestData + expect { datum.from_file(DIRECTORY) }.to raise_error(IOError) + end end end |