Skip to content

Instantly share code, notes, and snippets.

@sbellware
Created July 14, 2011 22:33
Show Gist options
  • Select an option

  • Save sbellware/1083635 to your computer and use it in GitHub Desktop.

Select an option

Save sbellware/1083635 to your computer and use it in GitHub Desktop.
module RSpec
module Core
module Hooks
def act(*args, &block)
scope, options = scope_and_options_from(*args)
hooks[:before][scope] << BeforeHook.new(options, &block)
end
def act_after(*args, &block)
scope, options = scope_and_options_from(*args)
hooks[:after][scope] << AfterHook.new(options, &block)
end
alias :cause :act_after
alias :act_on_double :act_after
end
end
module Mocks
module Methods
alias_method :should_have_received, :should_receive
alias_method :should_not_have_received, :should_not_receive
end
end
end
alias :context :describe
RSpec.configure do |config|
config.alias_example_to :observe
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment