Skip to content

Commit

Permalink
Add tests for file_clash behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea Nodari committed Mar 18, 2017
1 parent 60bd4d5 commit 8758356
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions spec/actions/create_file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,32 @@ def silence!
end
end
end

context "when file exists and it causes a file clash" do
before do
create_file("doc/config")
invoke!
end

it "generates a file clash" do
create_file("doc/config/config.rb")
expect(invoke!)
.to eq(" file_clash doc/config/config.rb\n")
end
end

context "when directory exists and it causes a file clash" do
before do
create_file("doc/config/hello")
invoke!
end

it "generates a file clash" do
create_file("doc/config")
expect(invoke!)
.to eq(" file_clash doc/config\n")
end
end
end

describe "#revoke!" do
Expand Down

0 comments on commit 8758356

Please sign in to comment.