Class: FIXSpec::Matchers::HaveFIXPath

Inherits:
Object
  • Object
show all
Defined in:
lib/fix_spec/matchers/have_fix_path.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ HaveFIXPath

Returns a new instance of HaveFIXPath.



5
6
7
8
# File 'lib/fix_spec/matchers/have_fix_path.rb', line 5

def initialize path
  @path = path
  @json_matcher = JsonSpec::Matchers::HaveJsonPath.new path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



4
5
6
# File 'lib/fix_spec/matchers/have_fix_path.rb', line 4

def path
  @path
end

Instance Method Details

#descriptionObject



24
25
26
# File 'lib/fix_spec/matchers/have_fix_path.rb', line 24

def description
  %(have Protobuf path "#{@path}")
end

#failure_message_for_shouldObject



16
17
18
# File 'lib/fix_spec/matchers/have_fix_path.rb', line 16

def failure_message_for_should
  %(Expected FIX path "#{@path}")
end

#failure_message_for_should_notObject



20
21
22
# File 'lib/fix_spec/matchers/have_fix_path.rb', line 20

def failure_message_for_should_not
  %(Expected no FIX path "#{@path}")
end

#matches?(fix_message) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
13
14
# File 'lib/fix_spec/matchers/have_fix_path.rb', line 10

def matches? fix_message
  fix_json =  FIXSpec::Helpers.message_to_unordered_json(fix_message)

  @json_matcher.matches? fix_json
end