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



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

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



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

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

#failure_message_for_shouldObject



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

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

#failure_message_for_should_notObject



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

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

#matches?(fix_message) ⇒ Boolean



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

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

  @json_matcher.matches? fix_json
end