dawanda_client 0.1.6

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.
@@ -0,0 +1,54 @@
1
+ require File.dirname(__FILE__) + '/../test_helper'
2
+
3
+ class DawandaTest < Test::Unit::TestCase
4
+
5
+ context "The Dawanda module" do
6
+
7
+ should "be able to set and retrieve the API key" do
8
+ Dawanda.api_key = 'key'
9
+ Dawanda.api_key.should == 'key'
10
+ end
11
+
12
+ should "be able to set and retrieve the country" do
13
+ Dawanda.country = 'de'
14
+ Dawanda.country.should == 'de'
15
+ end
16
+
17
+ should "be able to find a user by username" do
18
+ user = stub()
19
+
20
+ Dawanda::User.expects(:find_by_user_id).with('littletjane').returns(user)
21
+ Dawanda.user('littletjane').should == user
22
+ end
23
+
24
+ should "be able to find a shop by username" do
25
+ shop = stub()
26
+
27
+ Dawanda::Shop.expects(:find_by_user_id).with('littletjane').returns(shop)
28
+ Dawanda.shop('littletjane').should == shop
29
+ end
30
+
31
+ should "be able to find a product by id" do
32
+ product = stub()
33
+
34
+ Dawanda::Product.expects(:find_by_id).with(15).returns(product)
35
+ Dawanda.product(15).should == product
36
+ end
37
+
38
+ should "be able to find a category by id" do
39
+ category = stub()
40
+
41
+ Dawanda::Category.expects(:find_by_id).with(16).returns(category)
42
+ Dawanda.category(16).should == category
43
+ end
44
+
45
+ should "be able to find a shop category by id" do
46
+ shop_category = stub()
47
+
48
+ Dawanda::ShopCategory.expects(:find_by_id).with(16).returns(shop_category)
49
+ Dawanda.shop_category(16).should == shop_category
50
+ end
51
+
52
+ end
53
+
54
+ end
metadata ADDED
@@ -0,0 +1,91 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dawanda_client
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.6
5
+ platform: ruby
6
+ authors:
7
+ - "Christoph B\xC3\xBCnte"
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-10-13 00:00:00 +02:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: Describe your gem
17
+ email: info@christophbuente.de
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files:
23
+ - LICENSE
24
+ - README.rdoc
25
+ files:
26
+ - .gitignore
27
+ - LICENSE
28
+ - README.rdoc
29
+ - Rakefile
30
+ - VERSION
31
+ - dawanda_client.gemspec
32
+ - lib/dawanda.rb
33
+ - lib/dawanda/category.rb
34
+ - lib/dawanda/channel.rb
35
+ - lib/dawanda/color.rb
36
+ - lib/dawanda/model.rb
37
+ - lib/dawanda/product.rb
38
+ - lib/dawanda/request.rb
39
+ - lib/dawanda/response.rb
40
+ - lib/dawanda/shop.rb
41
+ - lib/dawanda/shop_category.rb
42
+ - lib/dawanda/user.rb
43
+ - test/fixtures/getCategoryDetails.json
44
+ - test/fixtures/getProductDetails.json
45
+ - test/fixtures/getShopDetails.json
46
+ - test/fixtures/getUserDetails.json
47
+ - test/test_helper.rb
48
+ - test/unit/dawanda/category_test.rb
49
+ - test/unit/dawanda/color_test.rb
50
+ - test/unit/dawanda/product_test.rb
51
+ - test/unit/dawanda/shop_category_test.rb
52
+ - test/unit/dawanda/shop_test.rb
53
+ - test/unit/dawanda/user_test.rb
54
+ - test/unit/dawanda_test.rb
55
+ has_rdoc: true
56
+ homepage: http://github.com/dawanda/dawanda_client
57
+ licenses: []
58
+
59
+ post_install_message:
60
+ rdoc_options:
61
+ - --charset=UTF-8
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: "0"
69
+ version:
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: "0"
75
+ version:
76
+ requirements: []
77
+
78
+ rubyforge_project:
79
+ rubygems_version: 1.3.5
80
+ signing_key:
81
+ specification_version: 3
82
+ summary: Provides a friendly ruby-like interface to the Dawanda API
83
+ test_files:
84
+ - test/test_helper.rb
85
+ - test/unit/dawanda/category_test.rb
86
+ - test/unit/dawanda/color_test.rb
87
+ - test/unit/dawanda/product_test.rb
88
+ - test/unit/dawanda/shop_category_test.rb
89
+ - test/unit/dawanda/shop_test.rb
90
+ - test/unit/dawanda/user_test.rb
91
+ - test/unit/dawanda_test.rb