Class: LedgerSync::Ledgers::TestLedger::Util::OperationErrorParser::DuplicateNameMatcher

Inherits:
ErrorMatcher
  • Object
show all
Defined in:
lib/ledger_sync/test/support/test_ledger/util/operation_error_parser.rb

Instance Attribute Summary

Attributes inherited from ErrorMatcher

#error, #message

Instance Method Summary collapse

Methods inherited from ErrorMatcher

#body, #code, #detail, #error_message, #initialize

Constructor Details

This class inherits a constructor from LedgerSync::Ledgers::TestLedger::Util::ErrorMatcher

Instance Method Details

#error_classObject



11
12
13
# File 'lib/ledger_sync/test/support/test_ledger/util/operation_error_parser.rb', line 11

def error_class
  Error::OperationError::DuplicateLedgerResourceError
end

#match?Boolean

Returns:

  • (Boolean)


19
20
21
22
# File 'lib/ledger_sync/test/support/test_ledger/util/operation_error_parser.rb', line 19

def match?
  code == 6240 ||
    message.include?('the name supplied already exists')
end

#output_messageObject



15
16
17
# File 'lib/ledger_sync/test/support/test_ledger/util/operation_error_parser.rb', line 15

def output_message
  "Resource with same name already exists: #{error_message}"
end