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 c766fc9 commit 42c887c
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions spec/actions/create_file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,38 @@ 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(<<-EOS
file_clash doc/config/config.rb
EOS
)
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(<<-EOS
file_clash doc/config
EOS
)
end
end
end

describe "#revoke!" do
Expand Down

0 comments on commit 42c887c

Please sign in to comment.