Sha256: a7312e1febf2ae452f21f9fb88fe1204c59f1f6e74beb02fb48eccf77c07e970

Contents?: true

Size: 1.39 KB

Versions: 14

Compression:

Stored size: 1.39 KB

Contents

module WebService
  module Client
    require 'test_helper'
    class SoapActionsTest < Test::Unit::TestCase
      def setup
        @base_url = "http://bobcatdev.library.nyu.edu"
      end

      def test_respond_to
        VCR.use_cassette('client nonexistent method') do
          client = Exlibris::Primo::WebService::Client::Search.new :base_url => @base_url
          assert(client.respond_to? :get_record)
          assert((not client.respond_to?(:nonexistent_action)))
        end
      end

      def test_nonexistent_action
        VCR.use_cassette('client nonexistent method') do
          client = Exlibris::Primo::WebService::Client::Search.new :base_url => @base_url
          assert_raise(NoMethodError) {
            client.nonexistent_action
          }
        end
      end

      def test_no_arguments
        VCR.use_cassette('client action no arguments') do
          client = Exlibris::Primo::WebService::Client::Search.new :base_url => @base_url
          assert_raise(ArgumentError, Savon::SOAPFault) {
            client.get_record
          }
        end
      end

      def test_too_many_arguments
        VCR.use_cassette('client too many arguments') do
          client = Exlibris::Primo::WebService::Client::Search.new :base_url => @base_url
          assert_raise(ArgumentError, Savon::SOAPFault) {
            client.get_record "1", "2"
          }
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
exlibris-primo-2.1.1 test/web_service/client/soap_actions_test.rb
exlibris-primo-2.1.0 test/web_service/client/soap_actions_test.rb
exlibris-primo-2.0.0 test/web_service/client/soap_actions_test.rb
exlibris-primo-1.1.9 test/web_service/client/soap_actions_test.rb
exlibris-primo-1.1.8 test/web_service/client/soap_actions_test.rb
exlibris-primo-1.1.7 test/web_service/client/soap_actions_test.rb
exlibris-primo-1.1.6 test/web_service/client/soap_actions_test.rb
exlibris-primo-1.1.5 test/web_service/client/soap_actions_test.rb
exlibris-primo-1.1.4 test/web_service/client/soap_actions_test.rb
exlibris-primo-1.1.3 test/web_service/client/soap_actions_test.rb
exlibris-primo-1.1.2 test/web_service/client/soap_actions_test.rb
exlibris-primo-1.1.1 test/web_service/client/soap_actions_test.rb
exlibris-primo-1.1.0 test/web_service/client/soap_actions_test.rb
exlibris-primo-1.0.11 test/web_service/client/soap_actions_test.rb