spec/swiftformat/swiftformat_spec.rb in danger-swiftformat-0.2.0 vs spec/swiftformat/swiftformat_spec.rb in danger-swiftformat-0.3.0
- old
+ new
@@ -82,9 +82,24 @@
.and_return("")
expect { @sut.check_format(%w(.)) }.to raise_error("error running swiftformat: empty output")
end
+ it "should support nil additional command line arguments" do
+ expect(@cmd).to receive(:run)
+ .with(%w(swiftformat . --dryrun --verbose))
+ .and_return(fixture("swiftformat_output.txt"))
+
+ output = {
+ errors: [],
+ stats: {
+ run_time: "0.08"
+ }
+ }
+
+ expect(@sut.check_format(%w(.), nil)).to eq(output)
+ end
+
it "should support additional command line arguments" do
expect(@cmd).to receive(:run)
.with(%w(swiftformat . --self insert --indent tab --dryrun --verbose))
.and_return(fixture("swiftformat_output.txt"))