Skip to content

Instantly share code, notes, and snippets.

@ledestin
Created January 9, 2014 09:25
Show Gist options
  • Save ledestin/8331598 to your computer and use it in GitHub Desktop.
Save ledestin/8331598 to your computer and use it in GitHub Desktop.
describe FrugalTimeout::Hookable do
before :all do
class Foo
extend FrugalTimeout::Hookable
def_hook :onBar
def run
@onBar.call
end
end
@foo = Foo.new
end
it 'works w/o user-defined hook' do
expect { @foo.run }.not_to raise_error
end
it 'calls user-defined hook' do
called = nil
@foo.onBar { called = true }
@foo.run
called.should == true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment