Class: HaveNotifiedWith

Inherits:
Object
  • Object
show all
Defined in:
lib/heroku_notification/rspec.rb

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ HaveNotifiedWith

Returns a new instance of HaveNotifiedWith.



4
5
6
# File 'lib/heroku_notification/rspec.rb', line 4

def initialize(params)
  @params = params
end

Instance Method Details

#failure_messageObject



15
16
17
# File 'lib/heroku_notification/rspec.rb', line 15

def failure_message
  "expected Notification to be posted with #{@params.inspect}"
end

#matches?(target) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
11
12
13
# File 'lib/heroku_notification/rspec.rb', line 8

def matches?(target)
  assert_notified_with(@params)
  true
rescue Spec::Expectations::ExpectationNotMetError
  false
end

#negative_failure_messageObject



18
19
20
# File 'lib/heroku_notification/rspec.rb', line 18

def negative_failure_message
  "expected Notification to not be posted with #{@params.inspect}"
end