nne_client 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.md +5 -0
 - data/lib/nne_client/result.rb +1 -1
 - data/lib/nne_client/version.rb +1 -1
 - data/spec/result_spec.rb +8 -0
 - data/spec/vcr_cassettes/result_no_trade.yml +40 -0
 - metadata +6 -4
 
    
        data/History.md
    CHANGED
    
    
    
        data/lib/nne_client/result.rb
    CHANGED
    
    | 
         @@ -68,7 +68,7 @@ module NNEClient 
     | 
|
| 
       68 
68 
     | 
    
         | 
| 
       69 
69 
     | 
    
         
             
                # List of trades
         
     | 
| 
       70 
70 
     | 
    
         
             
                def trades
         
     | 
| 
       71 
     | 
    
         
            -
                  trades = Fetch.new(tdc_id, 'fetchCompanyTrade').result_set.to_hash[:trade]
         
     | 
| 
      
 71 
     | 
    
         
            +
                  trades = Fetch.new(tdc_id, 'fetchCompanyTrade').result_set.to_hash[:trade] || []
         
     | 
| 
       72 
72 
     | 
    
         
             
                  if trades.kind_of?(Hash)
         
     | 
| 
       73 
73 
     | 
    
         
             
                    [Trade.new(trades)]
         
     | 
| 
       74 
74 
     | 
    
         
             
                  else
         
     | 
    
        data/lib/nne_client/version.rb
    CHANGED
    
    
    
        data/spec/result_spec.rb
    CHANGED
    
    | 
         @@ -114,6 +114,14 @@ describe NNEClient::Result do 
     | 
|
| 
       114 
114 
     | 
    
         
             
                end
         
     | 
| 
       115 
115 
     | 
    
         
             
              end
         
     | 
| 
       116 
116 
     | 
    
         | 
| 
      
 117 
     | 
    
         
            +
              context "with no trades" do
         
     | 
| 
      
 118 
     | 
    
         
            +
                it 'returns an empty array of trades' do
         
     | 
| 
      
 119 
     | 
    
         
            +
                  soap_vcr('result_no_trade') do
         
     | 
| 
      
 120 
     | 
    
         
            +
                    NNEClient::Result.new(:tdc_id => '202355845').trades.should == []
         
     | 
| 
      
 121 
     | 
    
         
            +
                  end
         
     | 
| 
      
 122 
     | 
    
         
            +
                end
         
     | 
| 
      
 123 
     | 
    
         
            +
              end
         
     | 
| 
      
 124 
     | 
    
         
            +
             
     | 
| 
       117 
125 
     | 
    
         
             
              context "with a single trade" do
         
     | 
| 
       118 
126 
     | 
    
         
             
                around(:each) do |example|
         
     | 
| 
       119 
127 
     | 
    
         
             
                  soap_vcr('result_trades') do
         
     | 
| 
         @@ -0,0 +1,40 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            --- 
         
     | 
| 
      
 2 
     | 
    
         
            +
            recorded_with: VCR 2.1.1
         
     | 
| 
      
 3 
     | 
    
         
            +
            http_interactions: 
         
     | 
| 
      
 4 
     | 
    
         
            +
            - request: 
         
     | 
| 
      
 5 
     | 
    
         
            +
                method: post
         
     | 
| 
      
 6 
     | 
    
         
            +
                uri: http://service.nnerhverv.dk/nne-ws/3.1/NNE
         
     | 
| 
      
 7 
     | 
    
         
            +
                body: 
         
     | 
| 
      
 8 
     | 
    
         
            +
                  string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ins0="http://com.stibo.net/nne/3.1/Types/NNE" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdl="http://com.stibo.net/nne/3.1/NNE"><env:Body><wsdl:fetchCompanyTrade env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><int_1 xsi:type="xsd:int">202355845</int_1><int_2 xsi:type="xsd:int">0</int_2><String_3 xsi:type="xsd:string"></String_3><String_4 xsi:type="xsd:string"></String_4></wsdl:fetchCompanyTrade></env:Body></env:Envelope>
         
     | 
| 
      
 9 
     | 
    
         
            +
                headers: 
         
     | 
| 
      
 10 
     | 
    
         
            +
                  content-type: 
         
     | 
| 
      
 11 
     | 
    
         
            +
                  - text/xml;charset=UTF-8
         
     | 
| 
      
 12 
     | 
    
         
            +
                  accept: 
         
     | 
| 
      
 13 
     | 
    
         
            +
                  - "*/*"
         
     | 
| 
      
 14 
     | 
    
         
            +
                  soapaction: 
         
     | 
| 
      
 15 
     | 
    
         
            +
                  - "\"fetchCompanyTrade\""
         
     | 
| 
      
 16 
     | 
    
         
            +
                  content-length: 
         
     | 
| 
      
 17 
     | 
    
         
            +
                  - "614"
         
     | 
| 
      
 18 
     | 
    
         
            +
              response: 
         
     | 
| 
      
 19 
     | 
    
         
            +
                status: 
         
     | 
| 
      
 20 
     | 
    
         
            +
                  code: 200
         
     | 
| 
      
 21 
     | 
    
         
            +
                  message: OK
         
     | 
| 
      
 22 
     | 
    
         
            +
                headers: 
         
     | 
| 
      
 23 
     | 
    
         
            +
                  content-type: 
         
     | 
| 
      
 24 
     | 
    
         
            +
                  - text/xml; charset="utf-8"
         
     | 
| 
      
 25 
     | 
    
         
            +
                  date: 
         
     | 
| 
      
 26 
     | 
    
         
            +
                  - Mon, 25 Jun 2012 14:00:40 GMT
         
     | 
| 
      
 27 
     | 
    
         
            +
                  x-powered-by: 
         
     | 
| 
      
 28 
     | 
    
         
            +
                  - ASP.NET
         
     | 
| 
      
 29 
     | 
    
         
            +
                  soapaction: 
         
     | 
| 
      
 30 
     | 
    
         
            +
                  - "\"\""
         
     | 
| 
      
 31 
     | 
    
         
            +
                  connection: 
         
     | 
| 
      
 32 
     | 
    
         
            +
                  - close
         
     | 
| 
      
 33 
     | 
    
         
            +
                  server: 
         
     | 
| 
      
 34 
     | 
    
         
            +
                  - Microsoft-IIS/6.0
         
     | 
| 
      
 35 
     | 
    
         
            +
                body: 
         
     | 
| 
      
 36 
     | 
    
         
            +
                  string: |-
         
     | 
| 
      
 37 
     | 
    
         
            +
                    <?xml version="1.0" encoding="UTF-8"?>
         
     | 
| 
      
 38 
     | 
    
         
            +
                    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns0="http://com.stibo.net/nne/3.1/Types/NNE" env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><env:Body><ans1:fetchCompanyTradeResponse xmlns:ans1="http://com.stibo.net/nne/3.1/NNE"><result href="#ID1"/></ans1:fetchCompanyTradeResponse><ns0:ArrayOfTrade id="ID1" xsi:type="enc:Array" enc:arrayType="ns0:Trade[0]"/></env:Body></env:Envelope>
         
     | 
| 
      
 39 
     | 
    
         
            +
                http_version: "1.1"
         
     | 
| 
      
 40 
     | 
    
         
            +
              recorded_at: Mon, 25 Jun 2012 14:00:40 GMT
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,13 +1,13 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification 
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: nne_client
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version 
         
     | 
| 
       4 
     | 
    
         
            -
              hash:  
     | 
| 
      
 4 
     | 
    
         
            +
              hash: 25
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: 
         
     | 
| 
       6 
6 
     | 
    
         
             
              segments: 
         
     | 
| 
       7 
7 
     | 
    
         
             
              - 0
         
     | 
| 
       8 
8 
     | 
    
         
             
              - 0
         
     | 
| 
       9 
     | 
    
         
            -
              -  
     | 
| 
       10 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 9 
     | 
    
         
            +
              - 3
         
     | 
| 
      
 10 
     | 
    
         
            +
              version: 0.0.3
         
     | 
| 
       11 
11 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       12 
12 
     | 
    
         
             
            authors: 
         
     | 
| 
       13 
13 
     | 
    
         
             
            - Jacob Atzen
         
     | 
| 
         @@ -15,7 +15,7 @@ autorequire: 
     | 
|
| 
       15 
15 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       16 
16 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       17 
17 
     | 
    
         | 
| 
       18 
     | 
    
         
            -
            date: 2012- 
     | 
| 
      
 18 
     | 
    
         
            +
            date: 2012-06-25 00:00:00 Z
         
     | 
| 
       19 
19 
     | 
    
         
             
            dependencies: 
         
     | 
| 
       20 
20 
     | 
    
         
             
            - !ruby/object:Gem::Dependency 
         
     | 
| 
       21 
21 
     | 
    
         
             
              name: savon
         
     | 
| 
         @@ -159,6 +159,7 @@ files: 
     | 
|
| 
       159 
159 
     | 
    
         
             
            - spec/vcr_cassettes/result_no_finance.yml
         
     | 
| 
       160 
160 
     | 
    
         
             
            - spec/vcr_cassettes/result_no_ownerships.yml
         
     | 
| 
       161 
161 
     | 
    
         
             
            - spec/vcr_cassettes/result_no_subsidiaries.yml
         
     | 
| 
      
 162 
     | 
    
         
            +
            - spec/vcr_cassettes/result_no_trade.yml
         
     | 
| 
       162 
163 
     | 
    
         
             
            - spec/vcr_cassettes/result_single_finance.yml
         
     | 
| 
       163 
164 
     | 
    
         
             
            - spec/vcr_cassettes/result_single_ownership.yml
         
     | 
| 
       164 
165 
     | 
    
         
             
            - spec/vcr_cassettes/result_single_subsidiary.yml
         
     | 
| 
         @@ -224,6 +225,7 @@ test_files: 
     | 
|
| 
       224 
225 
     | 
    
         
             
            - spec/vcr_cassettes/result_no_finance.yml
         
     | 
| 
       225 
226 
     | 
    
         
             
            - spec/vcr_cassettes/result_no_ownerships.yml
         
     | 
| 
       226 
227 
     | 
    
         
             
            - spec/vcr_cassettes/result_no_subsidiaries.yml
         
     | 
| 
      
 228 
     | 
    
         
            +
            - spec/vcr_cassettes/result_no_trade.yml
         
     | 
| 
       227 
229 
     | 
    
         
             
            - spec/vcr_cassettes/result_single_finance.yml
         
     | 
| 
       228 
230 
     | 
    
         
             
            - spec/vcr_cassettes/result_single_ownership.yml
         
     | 
| 
       229 
231 
     | 
    
         
             
            - spec/vcr_cassettes/result_single_subsidiary.yml
         
     |