Skip to content
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.

Commit

Permalink
Stub directory creation during tests
Browse files Browse the repository at this point in the history
  • Loading branch information
carols10cents committed Dec 31, 2011
1 parent 10fab7e commit 7a62cb4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions spec/unit/image_differ/image_differ_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
file_two = stub
strategy = stub(:diff => "diff_filename.png")
ChunkyPNG::Image.stubs(:from_file)
FileUtils.expects(:mkdir_p).with("something/diffs")

c = Compatriot::ImageDiffer.new(
:strategy => strategy,
Expand All @@ -47,12 +48,14 @@
strategy = stub

ChunkyPNG::Image.stubs(:from_file).returns(file_one, file_two)
FileUtils.expects(:mkdir_p).with("something/diffs")

strategy.expects(:diff).with(
file_one,
file_two,
"something"
).returns("diff_filename.png")

c = Compatriot::ImageDiffer.new(
:strategy => strategy,
:results_directory => "something"
Expand Down

0 comments on commit 7a62cb4

Please sign in to comment.