Skip to content

Instantly share code, notes, and snippets.

@timuruski
Created October 13, 2011 23:05
Show Gist options
  • Select an option

  • Save timuruski/1285789 to your computer and use it in GitHub Desktop.

Select an option

Save timuruski/1285789 to your computer and use it in GitHub Desktop.
RR has block mode.
image_a = Image.make
stub(image_a).migrated? { false }
stub(image_a).local_filename { 'spec/fixtures/backdrop.jpg' }
image_b = Image.make
stub(image_b).migrated? { false }
stub(image_b).local_filename { 'spec/fixtures/backdrop.jpg' }
document = Movie.new(:title => 'Test Movie', :images => [image_a, image_b])
mock(Fh::ImageryMigrator).migrate_image(image_a).once
mock(Fh::ImageryMigrator).migrate_image(image_b).once
# ---
stub(image_a = Image.make) do
migrated? { false }
local_filename { 'spec/fixtures/backdrop.jpg' }
end
stub(image_b = Image.make) do
migrated? { false }
local_filename { 'spec/fixtures/backdrop.jpg' }
end
mock(Fh::ImageryMigrator) do
migrate_image(image_a).once
migrate_image(image_b).once
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment