Sha256: 639b75aad9315fbfd68b4004efd902cf63fc05eda09a871676fc8d1ce68ec540

Contents?: true

Size: 619 Bytes

Versions: 29

Compression:

Stored size: 619 Bytes

Contents

RSpec::Matchers.define :be_a_valid_ebics_doc do

  ##
  # use #open instead of #read to have the includes working
  # http://stackoverflow.com/questions/11996326/nokogirixmlschema-syntaxerror-on-schema-load/22971456#22971456
  def xsd
    @xsd ||= Nokogiri::XML::Schema(File.open( File.join( File.dirname(__FILE__), '..', 'xsd', 'ebics_H004.xsd') ))
  end

  match do |actual|
    xsd.valid?(Nokogiri::XML(actual))
  end

  failure_message do |actual|
    "expected that #{actual} would be a valid EBICS doc:\n\n #{xsd.validate(Nokogiri::XML(actual))}"
  end

  description do
    "be a valid EBCIS document"
  end

end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
epics-2.6.0 spec/support/ebics_matcher.rb
epics-2.5.0 spec/support/ebics_matcher.rb
epics-2.4.0 spec/support/ebics_matcher.rb
epics-2.3.0 spec/support/ebics_matcher.rb
epics-2.2.0 spec/support/ebics_matcher.rb
epics-2.1.2 spec/support/ebics_matcher.rb
epics-2.1.1 spec/support/ebics_matcher.rb
epics-2.1.0 spec/support/ebics_matcher.rb
epics-2.0.0 spec/support/ebics_matcher.rb
epics-1.8.1 spec/support/ebics_matcher.rb
epics-1.8.0 spec/support/ebics_matcher.rb
epics-1.7.2 spec/support/ebics_matcher.rb
epics-1.7.1 spec/support/ebics_matcher.rb
epics-1.7.0 spec/support/ebics_matcher.rb
epics-1.6.0 spec/support/ebics_matcher.rb
epics-1.5.2 spec/support/ebics_matcher.rb
epics-1.5.1 spec/support/ebics_matcher.rb
epics-1.5.0 spec/support/ebics_matcher.rb
epics-1.4.1 spec/support/ebics_matcher.rb
epics-1.4.0 spec/support/ebics_matcher.rb