Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
describe Synchronizer do
class TestSynchorizer < Synchronizer
def initialize(can_sync)
@can_sync = can_sync
@performed = false
end
def can_sync?
@can_sync
end
def perform_sync
@performed = true
end
def performed?
@performed
end
end
describe "#perform" do
it "performs when can_sync returns true" do
ts = TestSynchronizer.new(true)
ts.sync
expect(ts.performed?).to eq(true)
end
it "doesn't perform when can_sync returns true" do
ts = TestSynchronizer.new(false)
ts.sync
expect(ts.performed?).to eq(false)
end
end
end
@kajatiger

This comment has been minimized.

Copy link

kajatiger commented Jul 25, 2017

aaah wow okay! So you are building the whole synchronizer as a test version!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.