bovespa-prices 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@ require 'httpclient'
2
2
  require 'nokogiri'
3
3
 
4
4
  class Bovespa
5
- VERSION = "1.0.1"
5
+ VERSION = "1.0.2"
6
6
 
7
7
  class Stock
8
8
  attr_accessor :code, :name, :date, :opening_price, :min_price, :max_price, :average_price, :last_price, :variation
@@ -31,6 +31,6 @@ class Bovespa
31
31
  result[st.code.to_sym] = st
32
32
  end
33
33
 
34
- result
34
+ return (stock_codes.size > 1 ? result : result[stock_codes.first])
35
35
  end
36
36
  end
@@ -80,13 +80,8 @@ describe Bovespa::Stock do
80
80
 
81
81
  result = Bovespa.new.get(:VALE5)
82
82
 
83
- result.should_not be_empty
84
- result.should be_a_kind_of Hash
85
- result.size.should == 1
86
- result.should have_key :VALE5
87
-
88
- result[:VALE5].should be_a_kind_of Bovespa::Stock
89
- result[:VALE5].to_s.should == "VALE5 - 'VALE PNA N1' 32.88 32.54 33.24 32.61 33.04 2.25"
83
+ result.should be_a_kind_of Bovespa::Stock
84
+ result.to_s.should == "VALE5 - 'VALE PNA N1' 32.88 32.54 33.24 32.61 33.04 2.25"
90
85
  end
91
86
 
92
87
  it "should parse a xml with two stocks from bovespa to one Stock" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bovespa-prices
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: