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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
aaah wow okay! So you are building the whole synchronizer as a test version!