quandl_client 0.1.15 → 0.1.16

Sign up to get free protection for your applications and to get access to all the features.
data/UPGRADE.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.1.16
2
+
3
+ * add sheet description
4
+
1
5
  ## 0.1.15
2
6
 
3
7
  * revise parse_json to respond with more informative error
@@ -38,7 +38,7 @@ class Sheet
38
38
  # PROPERTIES #
39
39
  ##############
40
40
 
41
- attributes :title, :content, :url_title, :full_url_title
41
+ attributes :title, :content, :url_title, :full_url_title, :description
42
42
 
43
43
  def html
44
44
  @html ||= self.attributes[:html] || Sheet.find(full_url_title).attributes[:html]
@@ -1,6 +1,6 @@
1
1
  module Quandl
2
2
  module Client
3
- VERSION = '0.1.15'
3
+ VERSION = '0.1.16'
4
4
  API_VERSION = 'v1'
5
5
 
6
6
  class << self
@@ -0,0 +1,8 @@
1
+ FactoryGirl.define do
2
+
3
+ factory :sheet do
4
+ sequence(:title) { |n| "Test sheet #{n} #{(Time.now.to_f * 1000).to_i}" }
5
+ description{ "Test sheet description."}
6
+ end
7
+
8
+ end
@@ -32,6 +32,18 @@ describe Dataset do
32
32
  its(:status){ should eq 201 }
33
33
 
34
34
  end
35
+ context "with data" do
36
+
37
+ before(:all){ Quandl::Client.token = ENV['QUANDL_AUTH_TOKEN'] }
38
+
39
+ let(:source){ create(:source) }
40
+ let(:dataset){ create(:dataset, source_code: source.code, data: Quandl::Data::Random.table(rows: 20, columns: 2, nils: false) ) }
41
+ subject{ dataset }
42
+
43
+ its(:saved?){ should be_true }
44
+ its(:status){ should eq 201 }
45
+
46
+ end
35
47
  end
36
48
 
37
49
  context "when updated" do
@@ -0,0 +1,37 @@
1
+ # encoding: utf-8
2
+ require 'spec_helper'
3
+
4
+ describe Sheet do
5
+
6
+ before(:all){ Quandl::Client.token = ENV['QUANDL_AUTH_TOKEN'] }
7
+
8
+ let(:sheet){ build(:sheet) }
9
+
10
+ subject{ sheet }
11
+
12
+ its(:valid?){ should be_true }
13
+
14
+ context "when saved" do
15
+
16
+ before(:each){ subject.save }
17
+ its(:saved?){ should be_true }
18
+
19
+ describe "#description" do
20
+
21
+ its(:description){ should eq "Test sheet description." }
22
+
23
+ it "should find the description" do
24
+ Sheet.find( subject.id ).description.should eq "Test sheet description."
25
+ end
26
+
27
+ it "should update the description" do
28
+ subject.description = "New description."
29
+ subject.save
30
+ Sheet.find( subject.id ).description.should eq "New description."
31
+ end
32
+
33
+ end
34
+
35
+ end
36
+
37
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quandl_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.15
4
+ version: 0.1.16
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-05 00:00:00.000000000 Z
12
+ date: 2013-09-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -251,12 +251,14 @@ files:
251
251
  - lib/quandl/her/patch.rb
252
252
  - quandl_client.gemspec
253
253
  - spec/factories/dataset.rb
254
+ - spec/factories/sheet.rb
254
255
  - spec/factories/source.rb
255
256
  - spec/quandl/client/dataset/location_spec.rb
256
257
  - spec/quandl/client/dataset/persistence_spec.rb
257
258
  - spec/quandl/client/dataset/search_spec.rb
258
259
  - spec/quandl/client/dataset/trim_spec.rb
259
260
  - spec/quandl/client/dataset/validation_spec.rb
261
+ - spec/quandl/client/sheet_spec.rb
260
262
  - spec/quandl/client/source_spec.rb
261
263
  - spec/spec_helper.rb
262
264
  homepage: http://blake.hilscher.ca/
@@ -286,11 +288,13 @@ specification_version: 3
286
288
  summary: Client rest orm.
287
289
  test_files:
288
290
  - spec/factories/dataset.rb
291
+ - spec/factories/sheet.rb
289
292
  - spec/factories/source.rb
290
293
  - spec/quandl/client/dataset/location_spec.rb
291
294
  - spec/quandl/client/dataset/persistence_spec.rb
292
295
  - spec/quandl/client/dataset/search_spec.rb
293
296
  - spec/quandl/client/dataset/trim_spec.rb
294
297
  - spec/quandl/client/dataset/validation_spec.rb
298
+ - spec/quandl/client/sheet_spec.rb
295
299
  - spec/quandl/client/source_spec.rb
296
300
  - spec/spec_helper.rb