Blame view

test/client_test.rb 625 Bytes
dc8aa5b6   Joe Weakley   Rubocop corrections
1
2
3
  # frozen_string_literal: true
  
  require 'test_helper'
51fb5579   Isaac Lewis   add client test, ...
4
5
  
  class SysproClientTest < Minitest::Test
dc8aa5b6   Joe Weakley   Rubocop corrections
6
    extend Minitest::Spec::DSL
f65bf747   Joe Weakley   Added and configu...
7
8
    before { VCR.insert_cassette name }
    after { VCR.eject_cassette }
dc8aa5b6   Joe Weakley   Rubocop corrections
9
10
11
  
    let(:client) { ::Syspro::SysproClient.new }
  
51fb5579   Isaac Lewis   add client test, ...
12
    def test_get_syspro_version
dc8aa5b6   Joe Weakley   Rubocop corrections
13
14
15
16
      assert_match(
        /(\d+\.)?(\d+\.)?(\d+\.)?(\d+)/,
        client.get_syspro_version.version
      )
51fb5579   Isaac Lewis   add client test, ...
17
    end
0c0af54a   Isaac Lewis   error handling; c...
18
19
  
    def test_client_block_execution
dc8aa5b6   Joe Weakley   Rubocop corrections
20
      version, resp = client.request do
0c0af54a   Isaac Lewis   error handling; c...
21
        Syspro::GetVersion.get_version
dc8aa5b6   Joe Weakley   Rubocop corrections
22
      end
0c0af54a   Isaac Lewis   error handling; c...
23
  
dc8aa5b6   Joe Weakley   Rubocop corrections
24
25
      assert_match(version.version, resp.http_body)
      assert_match(/(\d+\.)?(\d+\.)?(\d+\.)?(\d+)/, version.version)
0c0af54a   Isaac Lewis   error handling; c...
26
    end
51fb5579   Isaac Lewis   add client test, ...
27
  end