Blame view

test/client_test.rb 556 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
7
8
9
    extend Minitest::Spec::DSL
  
    let(:client) { ::Syspro::SysproClient.new }
  
51fb5579   Isaac Lewis   add client test, ...
10
    def test_get_syspro_version
dc8aa5b6   Joe Weakley   Rubocop corrections
11
12
13
14
      assert_match(
        /(\d+\.)?(\d+\.)?(\d+\.)?(\d+)/,
        client.get_syspro_version.version
      )
51fb5579   Isaac Lewis   add client test, ...
15
    end
0c0af54a   Isaac Lewis   error handling; c...
16
17
  
    def test_client_block_execution
dc8aa5b6   Joe Weakley   Rubocop corrections
18
      version, resp = client.request do
0c0af54a   Isaac Lewis   error handling; c...
19
        Syspro::GetVersion.get_version
dc8aa5b6   Joe Weakley   Rubocop corrections
20
      end
0c0af54a   Isaac Lewis   error handling; c...
21
  
dc8aa5b6   Joe Weakley   Rubocop corrections
22
23
      assert_match(version.version, resp.http_body)
      assert_match(/(\d+\.)?(\d+\.)?(\d+\.)?(\d+)/, version.version)
0c0af54a   Isaac Lewis   error handling; c...
24
    end
51fb5579   Isaac Lewis   add client test, ...
25
  end