Sha256: c78de27bf047cab35baa9781d6732f65b693dfd65005916192038b9f15f5f493

Contents?: true

Size: 990 Bytes

Versions: 1

Compression:

Stored size: 990 Bytes

Contents

require "spec_helper"

RSpec.describe Burlap::Listener do
  describe ".parse" do
    subject(:result) { Burlap.parse(reply) }

    context "when response is no such method" do
      let(:reply) { File.read("spec/data/no_such_method.burlap") }

      before { raise if reply.nil? }

      it "parses successfully" do
        expect(result).to be_a_kind_of(OpenStruct)
        expect(result.code).to eq("NoSuchMethodException")
        expect(result.message).to eq("The service has no method named: getUserID")
      end
    end

    describe "when response is record not found" do
      let(:reply) { File.read("spec/data/record_not_found.burlap") }

      before { raise if reply.nil? }

      it "parses successfully" do
        expect(result).to be_a_kind_of(Burlap::Fault)
        expect(result.code).to eq("ServiceException")
        expect(result.message).to eq("No row with the given identifier exists: [com.sapienter.jbilling.server.user.db.UserDTO#21]")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
burlap-1.0.0 spec/burlap/listener_spec.rb