spark_api 1.4.13 → 1.4.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTJiNGE3YjNiNGNmMTlmYmQ3YmRiMWVhNmE3N2M4ZjlkNTcyMDI5ZA==
4
+ Njk4NDliNTI2YjZjZjE1MjViYTk4NzYwYzcxNDJmYThlNzc0NzczMg==
5
5
  data.tar.gz: !binary |-
6
- YmIzMDkzMWZlOTI3YjNjY2U1ZWIzYzA1NjY2ZTJmMDUwZGIzMjVmOQ==
6
+ NzA5YTA4MTkwYTBiMmMxNmQ2MTExMWYzODllZjgyZGY1Mzg4ODNjZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZDhkZmIzNDJjZWE1Mjc1ZjYwM2JkYzFkYmYxOTExMWJkMTFmOTk2YTExMWJi
10
- MGY4NWY1NjI1ZTZiZWNiZWRhNzU4OTNhYzI3NGQxODA3MjczOGM5NWM0NmJl
11
- ZmRmMzcxMTk4ZjAwNGFiZTM4ZjgzMTE1NjYxMTY0NWZjNWFkOWM=
9
+ Y2JmYTY0YmRlYzAxNWNlNDllNTRmODQ2ZDNlZTkxMTIwYWM2ODhkZjc4MmJk
10
+ MTI2MzIyZGZlN2QwMTUwZTUzOTUxNDIwMTliZjRlYzc5ZDk5YmZlNWI0ZDg2
11
+ OTMyZmUyZDc3NDM4ZDlkYzI2Yjc1Y2IxNDA5ZmUwNjdiZjU0ZmQ=
12
12
  data.tar.gz: !binary |-
13
- YWNjYTNlZDM3ZTBhNjM1YzRkN2RjNThjNWZjMTk2MGM4ZjQ5YTU5N2M4NDQ0
14
- ZWYyY2U3YmQwZDA4MDNiOGJhYjNiYzlkNjY3YjVlM2Y5MzE0MDcxMjgxM2Y0
15
- Njk2ZTA2MzllNGYzMTY3OGM4YmY0ZmFhN2MxNzZhMzJjZjAwNWM=
13
+ ZjQ2YTQyMjAwMTJiMzQwZTQ0MWM4MjFjNDQ0MjY3NTdkMDRjN2Y0YTY5Yzcw
14
+ NzRiYTUwMWY5YTcxOGRlODZjOTc4NDVlMzA3ZWVmZGRmYWU3MzI4YjNjYjky
15
+ YTJlZGI3MDQwZjRlNTJlNzQ3NzExNzY5ZWM2N2EzZjQ1NDg4M2M=
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.13
1
+ 1.4.14
@@ -31,7 +31,11 @@ module SparkApi
31
31
  private
32
32
 
33
33
  def data
34
- @data ||= connection.get(self.path).first
34
+ if attributes.empty?
35
+ @data ||= connection.get(self.path).first
36
+ else
37
+ attributes
38
+ end
35
39
  end
36
40
 
37
41
  end
@@ -48,6 +48,10 @@ end
48
48
  Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f}
49
49
 
50
50
  RSpec.configure do |config|
51
+
52
+ config.include WebMock::API
53
+ config.include StubApiRequests
54
+
51
55
  config.treat_symbols_as_metadata_keys_with_true_values = true
52
56
  config.alias_example_to :on_get_it, :method => 'GET'
53
57
  config.alias_example_to :on_put_it, :method => 'PUT'
@@ -10,6 +10,14 @@ describe NewsFeedMeta do
10
10
  stub_api_get("/newsfeeds/meta", "newsfeeds/meta.json")
11
11
  end
12
12
 
13
+ describe 'fetching data' do
14
+ it "only makes one api request" do
15
+ news_feed_meta = NewsFeedMeta.get.first
16
+ news_feed_meta.minimum_core_fields
17
+ expect_api_request(:get, "/newsfeeds/meta").to have_been_made.once
18
+ end
19
+ end
20
+
13
21
  describe 'minimum_core_fields' do
14
22
  it 'returns the minimum number of required fields' do
15
23
  expect(news_feed_meta.minimum_core_fields).to eq 3
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spark_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.13
4
+ version: 1.4.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Hornseth
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-01-26 00:00:00.000000000 Z
12
+ date: 2017-06-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday