Module: Fakettp::ExpectationHelper

Defined in:
lib/fakettp/expectation_helper.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(cls) ⇒ Object



5
6
7
# File 'lib/fakettp/expectation_helper.rb', line 5

def self.included(cls)
  cls.send :include, Spec::Matchers
end

Instance Method Details

#expect(label) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/fakettp/expectation_helper.rb', line 9

def expect label
  begin
    yield
  rescue Exception => e
    raise Fakettp::Expectation::Error.new("Error in #{label}: #{e.message}")
  end
end