Sha256: b159eaea02947f745b78787844e02a8f0d1eb4a431cfb7d4c6181823532f9f9b

Contents?: true

Size: 977 Bytes

Versions: 11

Compression:

Stored size: 977 Bytes

Contents

require 'spec_helper'

describe NNEClient::Ownership do
  let(:ownership_hash) do
    {
      :country     => "Holland",
      :"@xsi:type" => "ns0:Ownership",
      :share       => "100            ",
      :tdc_id      => "123",
      :@id         => "ID2",
      :name        => "Ingka Holding Scandinavia Bv"
    }
  end

  subject { NNEClient::Ownership.new(ownership_hash) }

  it            { should eq NNEClient::Ownership.new(ownership_hash) }
  its(:share)   { should == '100' }
  its(:name)    { should == ownership_hash[:name] }
  its(:country) { should == ownership_hash[:country] }

  describe "#company" do
    let(:result)     { double(:result) }

    it "knows how to fetch company information" do
      NNEClient::Result.should_receive(:new).with(:tdc_id => '123') { result }
      subject.company
    end
    it "knows how to fetch company information" do
      NNEClient::Result.stub(:new) { result }
      subject.company.should == result
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
nne_client-0.0.11 spec/ownership_spec.rb
nne_client-0.0.10 spec/ownership_spec.rb
nne_client-0.0.9 spec/ownership_spec.rb
nne_client-0.0.8 spec/ownership_spec.rb
nne_client-0.0.7 spec/ownership_spec.rb
nne_client-0.0.6 spec/ownership_spec.rb
nne_client-0.0.5 spec/ownership_spec.rb
nne_client-0.0.4 spec/ownership_spec.rb
nne_client-0.0.3 spec/ownership_spec.rb
nne_client-0.0.2 spec/ownership_spec.rb
nne_client-0.0.1 spec/ownership_spec.rb