dribbble-bucket-api 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,8 +13,7 @@ module DribbbleBucketApi
13
13
  unless response.code == 200
14
14
  raise StandardError, %Q(
15
15
  Response returned #{response.code}
16
- Body:
17
- #{response.body}
16
+ URI: #{response.request.path}
18
17
  )
19
18
  end
20
19
  # return the object
@@ -27,8 +26,7 @@ module DribbbleBucketApi
27
26
  unless response.code == 200
28
27
  raise StandardError, %Q(
29
28
  Response returned #{response.code}
30
- Body:
31
- #{response.body}
29
+ URI: #{response.request.path}
32
30
  )
33
31
  end
34
32
  # return the object
@@ -6,7 +6,7 @@ module DribbbleBucketApi
6
6
  def initialize(attrs = {})
7
7
  @attrs = attrs
8
8
  # ensure we have an id
9
- unless @attrs.has_key?(:id)
9
+ unless @attrs.has_key?(:id) && @attrs[:id]
10
10
  raise ArgumentError, "Shot must be initialized with an id"
11
11
  end
12
12
  end
@@ -34,10 +34,6 @@ module DribbbleBucketApi
34
34
  end
35
35
 
36
36
  private
37
- def username
38
- @options[:username]
39
- end
40
-
41
37
  def document
42
38
  @document ||= Nokogiri::HTML(@body)
43
39
  end
@@ -1,3 +1,3 @@
1
1
  module DribbbleBucketApi
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -7,6 +7,16 @@ describe DribbbleBucketApi::Shot do
7
7
  subject do
8
8
  DribbbleBucketApi::Shot.new({ id: id })
9
9
  end
10
+
11
+ describe "::new" do
12
+ context "without an id" do
13
+ let(:id) { nil }
14
+
15
+ it "should raise an exception" do
16
+ expect { subject }.to raise_error(ArgumentError)
17
+ end
18
+ end
19
+ end
10
20
 
11
21
  describe "#image_url" do
12
22
  context "when the image_url has not yet been loaded" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dribbble-bucket-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
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: 2012-08-31 00:00:00.000000000 Z
12
+ date: 2012-09-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri