summaryrefslogtreecommitdiff
path: root/spec/unit/chef_fs/file_system/repository/base_file_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/chef_fs/file_system/repository/base_file_spec.rb')
-rw-r--r--spec/unit/chef_fs/file_system/repository/base_file_spec.rb18
1 files changed, 8 insertions, 10 deletions
diff --git a/spec/unit/chef_fs/file_system/repository/base_file_spec.rb b/spec/unit/chef_fs/file_system/repository/base_file_spec.rb
index bb0c267368..625ef32dca 100644
--- a/spec/unit/chef_fs/file_system/repository/base_file_spec.rb
+++ b/spec/unit/chef_fs/file_system/repository/base_file_spec.rb
@@ -47,7 +47,7 @@ describe Chef::ChefFS::FileSystem::Repository::BaseFile do
end
context "#is_json_file?" do
- it "returns false when the file is not json" do
+ it "returns false when the file is not json", pending: "We assume that everything is ruby or JSON" do
file = described_class.new("test_file.dpkg", parent)
expect(file.is_json_file?).to be_falsey
end
@@ -63,11 +63,16 @@ describe Chef::ChefFS::FileSystem::Repository::BaseFile do
expect(file.name_valid?).to be_falsey
end
- it "rejects non json files" do
+ it "rejects non json files", pending: "We assume that everything is ruby or JSON" do
file = described_class.new("test_file.dpkg", parent)
expect(file.name_valid?).to be_falsey
end
+ it "allows ruby files" do
+ file = described_class.new("test_file.rb", parent)
+ expect(file.name_valid?).to be_truthy
+ end
+
it "allows correctly named files" do
expect(file.name_valid?).to be_truthy
end
@@ -105,14 +110,7 @@ describe Chef::ChefFS::FileSystem::Repository::BaseFile do
context "#write" do
context "minimises a json object" do
- it "not if pretty json is off" do
- expect(file).to_not receive(:minimize)
- file.write(content)
- end
-
- it "not if it's not a json file" do
- file = described_class.new("test_file.dpkg", parent)
- file.write_pretty_json = true
+ it "unless pretty json is off" do
expect(file).to_not receive(:minimize)
file.write(content)
end