goodreads 0.4.3 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,54 +1,54 @@
1
- require 'spec_helper'
1
+ require "spec_helper"
2
2
 
3
- describe 'Goodreads' do
4
- describe '.new' do
5
- it 'returns a new client instance' do
6
- Goodreads.new.should be_a Goodreads::Client
3
+ describe "Goodreads" do
4
+ describe ".new" do
5
+ it "returns a new client instance" do
6
+ expect(Goodreads.new).to be_a(Goodreads::Client)
7
7
  end
8
8
  end
9
9
 
10
- describe '.configure' do
11
- it 'sets a global configuration options' do
12
- r = Goodreads.configure(:api_key => 'FOO', :api_secret => 'BAR')
13
- r.should be_a Hash
14
- r.should have_key(:api_key)
15
- r.should have_key(:api_secret)
16
- r[:api_key].should eql('FOO')
17
- r[:api_secret].should eql('BAR')
10
+ describe ".configure" do
11
+ it "sets a global configuration options" do
12
+ config = Goodreads.configure(api_key: "FOO", api_secret: "BAR")
13
+ expect(config).to be_a(Hash)
14
+ expect(config).to have_key(:api_key)
15
+ expect(config).to have_key(:api_secret)
16
+ expect(config[:api_key]).to eql("FOO")
17
+ expect(config[:api_secret]).to eql("BAR")
18
18
  end
19
19
 
20
- it 'raises ConfigurationError on invalid config parameter' do
21
- proc { Goodreads.configure(nil) }.
22
- should raise_error(ArgumentError, "Options hash required.")
20
+ it "raises ConfigurationError on invalid config parameter" do
21
+ expect { Goodreads.configure(nil) }
22
+ .to raise_error(ArgumentError, "Options hash required.")
23
23
 
24
- proc { Goodreads.configure('foo') }.
25
- should raise_error ArgumentError, "Options hash required."
24
+ expect { Goodreads.configure("foo") }
25
+ .to raise_error(ArgumentError, "Options hash required.")
26
26
  end
27
27
  end
28
28
 
29
- describe '.configuration' do
29
+ describe ".configuration" do
30
30
  before do
31
- Goodreads.configure(:api_key => 'FOO', :api_secret => 'BAR')
31
+ Goodreads.configure(api_key: "FOO", api_secret: "BAR")
32
32
  end
33
33
 
34
- it 'returns global configuration options' do
35
- r = Goodreads.configuration
36
- r.should be_a Hash
37
- r.should have_key(:api_key)
38
- r.should have_key(:api_secret)
39
- r[:api_key].should eql('FOO')
40
- r[:api_secret].should eql('BAR')
34
+ it "returns global configuration options" do
35
+ config = Goodreads.configuration
36
+ expect(config).to be_a(Hash)
37
+ expect(config).to have_key(:api_key)
38
+ expect(config).to have_key(:api_secret)
39
+ expect(config[:api_key]).to eql("FOO")
40
+ expect(config[:api_secret]).to eql("BAR")
41
41
  end
42
42
  end
43
43
 
44
- describe '.reset_configuration' do
44
+ describe ".reset_configuration" do
45
45
  before do
46
- Goodreads.configure(:api_key => 'FOO', :api_secret => 'BAR')
46
+ Goodreads.configure(api_key: "FOO", api_secret: "BAR")
47
47
  end
48
48
 
49
- it 'resets global configuration options' do
49
+ it "resets global configuration options" do
50
50
  Goodreads.reset_configuration
51
- Goodreads.configuration.should eql({})
51
+ expect(Goodreads.configuration).to eql({})
52
52
  end
53
53
  end
54
54
  end
@@ -1,32 +1,32 @@
1
- $:.unshift File.expand_path("../..", __FILE__)
1
+ $LOAD_PATH.unshift(File.expand_path("../..", __FILE__))
2
2
 
3
- require 'simplecov'
3
+ require "simplecov"
4
4
 
5
5
  SimpleCov.start do
6
6
  add_filter "spec/"
7
7
  add_filter ".bundle"
8
8
  end
9
9
 
10
- require 'goodreads'
11
- require 'webmock'
12
- require 'webmock/rspec'
10
+ require "goodreads"
11
+ require "webmock"
12
+ require "webmock/rspec"
13
13
 
14
14
  def stub_get(path, params, fixture_name)
15
- params[:format] = 'xml'
16
- stub_request(:get, api_url(path)).
17
- with(:query => params).
18
- to_return(
19
- :status => 200,
20
- :body => fixture(fixture_name)
15
+ params[:format] = "xml"
16
+ stub_request(:get, api_url(path))
17
+ .with(query: params)
18
+ .to_return(
19
+ status: 200,
20
+ body: fixture(fixture_name)
21
21
  )
22
22
  end
23
23
 
24
24
  def stub_with_key_get(path, params, fixture_name)
25
- params[:key] = 'SECRET_KEY'
25
+ params[:key] = "SECRET_KEY"
26
26
  stub_get(path, params, fixture_name)
27
27
  end
28
28
 
29
- def fixture_path(file=nil)
29
+ def fixture_path(file = nil)
30
30
  path = File.expand_path("../fixtures", __FILE__)
31
31
  file.nil? ? path : File.join(path, file)
32
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: goodreads
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Sosedoff
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-11 00:00:00.000000000 Z
11
+ date: 2017-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: webmock
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.11'
19
+ version: '2.0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.11'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '1.6'
89
+ version: '2.0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '1.6'
96
+ version: '2.0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: hashie
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -159,6 +159,7 @@ extra_rdoc_files: []
159
159
  files:
160
160
  - ".gitignore"
161
161
  - ".rspec"
162
+ - ".rubocop.yml"
162
163
  - ".travis.yml"
163
164
  - Gemfile
164
165
  - LICENSE
@@ -219,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
219
220
  version: '0'
220
221
  requirements: []
221
222
  rubyforge_project:
222
- rubygems_version: 2.4.3
223
+ rubygems_version: 2.6.13
223
224
  signing_key:
224
225
  specification_version: 4
225
226
  summary: Goodreads API wrapper
@@ -244,4 +245,3 @@ test_files:
244
245
  - spec/fixtures/user.xml
245
246
  - spec/goodreads_spec.rb
246
247
  - spec/spec_helper.rb
247
- has_rdoc: