Sha256: d900494a3629e28ce3e055597d6807c375513a07e24a2b4f1bfaa783c0993a60

Contents?: true

Size: 1.39 KB

Versions: 11

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::SOAP::Fault) {
            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::SOAP::Fault) {
            client.get_record "1", "2"
          }
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
exlibris-primo-1.0.10 test/web_service/client/soap_actions_test.rb
exlibris-primo-1.0.9 test/web_service/client/soap_actions_test.rb
exlibris-primo-1.0.8 test/web_service/client/soap_actions_test.rb
exlibris-primo-1.0.7 test/web_service/client/soap_actions_test.rb
exlibris-primo-1.0.6 test/web_service/client/soap_actions_test.rb
exlibris-primo-1.0.5 test/web_service/client/soap_actions_test.rb
exlibris-primo-1.0.4 test/web_service/client/soap_actions_test.rb
exlibris-primo-1.0.3 test/web_service/client/soap_actions_test.rb
exlibris-primo-1.0.2 test/web_service/client/soap_actions_test.rb
exlibris-primo-1.0.1 test/web_service/client/soap_actions_test.rb
exlibris-primo-1.0.0 test/web_service/client/soap_actions_test.rb