summaryrefslogtreecommitdiff
path: root/spec/functional/mixin/from_file_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/functional/mixin/from_file_spec.rb')
-rw-r--r--spec/functional/mixin/from_file_spec.rb11
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