thumbtack 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3d86b3db897475f83812368d11f5179d8b098af6
4
- data.tar.gz: d92ba1381ba92772a4b7610b70c3d53a839f0f1d
3
+ metadata.gz: b204797fab0cc2277a9a96a0fb7f117351e77682
4
+ data.tar.gz: e58eb6b1b2e6e82b4c8d90cbef2cda993756884b
5
5
  SHA512:
6
- metadata.gz: d9ad33c40ef19811c378c9bbc6f09e54151ecb5a8c657ad05f48916f0a1b4e87ce152a1508c51a6ae290257287c5a7d0cbd463fe68dae6296a0502e5cddc2ef8
7
- data.tar.gz: 32bd3769072670a57804a306fc46f78db993dbc6e91bd395a7433491c74381a13176f900429faab5f82b45f2b5e3a862e8e286c7636894631e9c949e4c3026e1
6
+ metadata.gz: edcf405a5c45dd0dd17786f292a650a44ba543de43a4318afd363b1acb592abe9b9893f037b32624a9410bc2f654eac5345708529db054919c3e1629bc41d380
7
+ data.tar.gz: 625d10851ca09eb39916d42c34edbcebd6db93bb1e8f1d318a9048cab8283c1d2effc35377da3c4c829723e28b7f8e463b54bd5a8bff48fc4ec97bf76b3bda37
@@ -7,9 +7,9 @@ module Thumbtack
7
7
  ATTRIBUTES = [
8
8
  :id,
9
9
  :title,
10
- :hash,
11
10
  :created_at,
12
11
  :updated_at,
12
+ :digest,
13
13
  :text,
14
14
  :length
15
15
  ].freeze
@@ -20,7 +20,9 @@ module Thumbtack
20
20
  #
21
21
  # hash - A Hash of attributes of the note.
22
22
  def self.from_hash(hash)
23
- new(Hash[hash.map { |key, value| [key.to_sym, value] }])
23
+ attrs = hash.dup
24
+ digest = attrs.delete('hash')
25
+ new(Hash[attrs.map { |k, v| [k.to_sym, v] }].merge(digest: digest))
24
26
  end
25
27
 
26
28
  # Internal: Initialize a Note.
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Thumbtack
4
4
  # Gem version
5
- VERSION = '0.0.1'.freeze
5
+ VERSION = '0.0.2'.freeze
6
6
  end
@@ -1,4 +1,6 @@
1
1
  # encoding: utf-8
2
+ require 'codeclimate-test-reporter'
3
+ CodeClimate::TestReporter.start
2
4
 
3
5
  require 'thumbtack'
4
6
  require 'minitest/autorun'
@@ -7,16 +7,6 @@ class ClientTest < Minitest::Test
7
7
  @client = Client.new(username, token)
8
8
  end
9
9
 
10
- def test_requests_return_parsed_json
11
- response = @client.get('/user/api_token')
12
- assert_equal({ 'result' => token }, response)
13
- end
14
-
15
- def test_request_query_parameters
16
- response = @client.get('/tags/delete', tag: 'thumbtack-test-query-params')
17
- assert_equal({ 'result' => 'done' }, response)
18
- end
19
-
20
10
  def test_posts
21
11
  assert_instance_of Posts, @client.posts
22
12
  end
@@ -0,0 +1,21 @@
1
+ # encoding: utf-8
2
+
3
+ require 'test_helper'
4
+
5
+ module Integration
6
+ class ClientTest < Minitest::Test
7
+ def setup
8
+ @client = Client.new(username, token)
9
+ end
10
+
11
+ def test_requests_return_parsed_json
12
+ response = @client.get('/user/api_token')
13
+ assert_equal({ 'result' => token }, response)
14
+ end
15
+
16
+ def test_request_query_parameters
17
+ response = @client.get('/tags/delete', tag: 'thumbtack-test-query-params')
18
+ assert_equal({ 'result' => 'done' }, response)
19
+ end
20
+ end
21
+ end
@@ -17,7 +17,7 @@ class NoteTest < Minitest::Test
17
17
 
18
18
  assert_equal '8e5d6964bb810e0050b0', note.id
19
19
  assert_equal 'StarCraft beta coming this week!', note.title
20
- assert_equal '0c9c30f60cadabd31415', note.hash
20
+ assert_equal '0c9c30f60cadabd31415', note.digest
21
21
  assert_equal '2010-02-11 03:46:56', note.created_at
22
22
  assert_equal '2010-02-11 03:47:47', note.updated_at
23
23
  assert_equal 19, note.length
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thumbtack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nate Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-17 00:00:00.000000000 Z
11
+ date: 2014-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.6.2
19
+ version: 1.7.2
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.6.2
26
+ version: 1.7.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: minitest
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -97,6 +97,7 @@ files:
97
97
  - lib/thumbtack/version.rb
98
98
  - test/test_helper.rb
99
99
  - test/thumbtack/client_test.rb
100
+ - test/thumbtack/integration/client_test.rb
100
101
  - test/thumbtack/note_summary_test.rb
101
102
  - test/thumbtack/note_test.rb
102
103
  - test/thumbtack/notes_test.rb
@@ -142,6 +143,7 @@ summary: The best Pinboard API client
142
143
  test_files:
143
144
  - test/test_helper.rb
144
145
  - test/thumbtack/client_test.rb
146
+ - test/thumbtack/integration/client_test.rb
145
147
  - test/thumbtack/note_summary_test.rb
146
148
  - test/thumbtack/note_test.rb
147
149
  - test/thumbtack/notes_test.rb