Class: Spec::Matchers::SpecExtensions::HaveService

Inherits:
SpecExtensionsBase show all
Defined in:
lib/poolparty/spec/matchers/have_service.rb

Instance Method Summary collapse

Methods inherited from SpecExtensionsBase

#ensured_as, #grab_entry, #is_present?, #is_valid_resource?

Constructor Details

#initialize(expected, extra = "") ⇒ HaveService

Returns a new instance of HaveService.



5
6
7
8
# File 'lib/poolparty/spec/matchers/have_service.rb', line 5

def initialize(expected,extra="")
  @expected = expected
  @extra = extra
end

Instance Method Details

#failure_messageObject



13
14
15
# File 'lib/poolparty/spec/matchers/have_service.rb', line 13

def failure_message
  "expected #{@target.inspect} to have service #{@expected}"
end

#matches?(target) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
12
# File 'lib/poolparty/spec/matchers/have_service.rb', line 9

def matches?(target)
  @target = target
  is_present?
end

#negative_failure_messageObject



16
17
18
# File 'lib/poolparty/spec/matchers/have_service.rb', line 16

def negative_failure_message
  "expected #{@target.inspect} not to have service #{@expected}"
end

#typeObject



19
20
21
# File 'lib/poolparty/spec/matchers/have_service.rb', line 19

def type
  "service"
end