Sha256: d48b0b7922b120174a869aeccf3b21ec98c6ecaf8e6d764837715f74816260e3

Contents?: true

Size: 636 Bytes

Versions: 1

Compression:

Stored size: 636 Bytes

Contents

require "spec_helper"

class BaseDummy
  include Xmlenc::Builder::Base

  tag "tag"
end

describe BaseDummy do
  describe "parse override" do
    it "sets the from_xml flag" do
      expect(BaseDummy.parse("<tag></tag>", :single => true).from_xml?).to be_truthy
    end

    it "raises an error if the message cannot be parsed" do
      expect {
        BaseDummy.parse("invalid")
      }.to raise_error(Xmlenc::UnparseableMessage)
    end

    it "raises an error if the message is nil" do
      expect {
        BaseDummy.parse(nil)
      }.to raise_error(Xmlenc::UnparseableMessage, 'Unable to parse nil document')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
xmlenc-0.8.0 spec/lib/xmlenc/builder/base_spec.rb