ebay 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
data/test/TODO ADDED
@@ -0,0 +1,16 @@
1
+ TODO
2
+ ----
3
+
4
+ There are many, many more tests that need to be performed.
5
+
6
+ The eBay API now has over 100 possible calls, so if you use this library in
7
+ your eBay application, please consider giving back to the project by writing
8
+ a test case or two.
9
+
10
+ Please email test cases to: gdolley@ucla.edu
11
+
12
+ Include your full name so I can give you credit and copyright stamp.
13
+
14
+ Thanks!
15
+
16
+ -- Garry
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ #--
4
+ #
5
+ # Copyright (c) 2005 Garry C. Dolley
6
+ #
7
+ # This file is part of eBay4R.
8
+ #
9
+ # eBay4R is free software; you can redistribute it and/or modify it under the
10
+ # terms of the GNU General Public License as published by the Free Software
11
+ # Foundation; either version 2 of the License, or (at your option) any later
12
+ # version.
13
+ #
14
+ # eBay4R is distributed in the hope that it will be useful, but WITHOUT ANY
15
+ # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16
+ # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17
+ # details.
18
+ #
19
+ # You should have received a copy of the GNU General Public License along with
20
+ # eBay4R; if not, write to the Free Software Foundation, Inc., 51 Franklin
21
+ # Street, Fifth Floor, Boston, MA 02110-1301, USA
22
+ #
23
+ #++
24
+
25
+ $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
26
+
27
+ require 'test/unit'
28
+ require 'eBayAPI'
29
+
30
+ # This file must be in the current directory your $RUBYLIB environment var.
31
+ load('myCredentials.rb')
32
+
33
+ $eBay = EBay::API.new($authToken, $devId, $appId, $certId, :sandbox => true)
34
+
35
+ class TestHelloWorld < Test::Unit::TestCase
36
+ def test_simplest_call
37
+ resp = $eBay.GeteBayOfficialTime
38
+
39
+ assert_respond_to(resp, "timestamp")
40
+ assert_respond_to(resp, "ack")
41
+ assert_equal(resp.ack, "Success")
42
+
43
+ assert(resp.timestamp != "")
44
+ end
45
+ end
data/test/tc_items.rb ADDED
@@ -0,0 +1,78 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ #--
4
+ #
5
+ # Copyright (c) 2005 Garry C. Dolley
6
+ #
7
+ # This file is part of eBay4R.
8
+ #
9
+ # eBay4R is free software; you can redistribute it and/or modify it under the
10
+ # terms of the GNU General Public License as published by the Free Software
11
+ # Foundation; either version 2 of the License, or (at your option) any later
12
+ # version.
13
+ #
14
+ # eBay4R is distributed in the hope that it will be useful, but WITHOUT ANY
15
+ # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16
+ # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17
+ # details.
18
+ #
19
+ # You should have received a copy of the GNU General Public License along with
20
+ # eBay4R; if not, write to the Free Software Foundation, Inc., 51 Franklin
21
+ # Street, Fifth Floor, Boston, MA 02110-1301, USA
22
+ #
23
+ #++
24
+
25
+ $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
26
+
27
+ require 'test/unit'
28
+ require 'eBayAPI'
29
+
30
+ # This file must be in the current directory your $RUBYLIB environment var.
31
+ load('myCredentials.rb')
32
+
33
+ $eBay = EBay::API.new($authToken, $devId, $appId, $certId, :sandbox => true)
34
+
35
+ class TestItems < Test::Unit::TestCase
36
+ @@item_title = 'eBay4R Test Case Item';
37
+ @@item_descr = 'eBay API for Ruby @ http://ebay4r.rubyforge.org/';
38
+
39
+ def test_add_item
40
+ resp = $eBay.AddItem(:Item => EBay.Item(:PrimaryCategory => EBay.Category(:CategoryID => 57882),
41
+ :Title => @@item_title,
42
+ :Description => @@item_descr,
43
+ :Location => 'RubyForge',
44
+ :StartPrice => 12.0,
45
+ :Quantity => 1,
46
+ :ListingDuration => "Days_7",
47
+ :Country => "US",
48
+ :Currency => "USD",
49
+ :PaymentMethods => ["VisaMC", "PersonalCheck"]))
50
+
51
+ assert_respond_to(resp, "timestamp")
52
+ assert_respond_to(resp, "ack")
53
+ assert_equal(resp.ack, "Success")
54
+
55
+ assert_respond_to(resp, "itemID")
56
+ assert_not_nil(resp.itemID)
57
+
58
+ @@item_id = resp.itemID
59
+
60
+ assert_respond_to(resp, "fees")
61
+ end
62
+
63
+ def test_add_item_no_params
64
+ assert_raise(EBay::Error::ApplicationError) { $eBay.AddItem() }
65
+ end
66
+
67
+ def test_get_item
68
+ resp = $eBay.GetItem(:DetailLevel => 'ReturnAll', :ItemID => @@item_id)
69
+
70
+ assert_respond_to(resp, "timestamp")
71
+ assert_respond_to(resp, "ack")
72
+ assert_equal(resp.ack, "Success")
73
+
74
+ assert_equal(resp.item.title, @@item_title)
75
+ assert_equal(resp.item.description, @@item_descr)
76
+ end
77
+
78
+ end
metadata ADDED
@@ -0,0 +1,63 @@
1
+ !ruby/object:Gem::Specification
2
+ rubygems_version: 0.8.11
3
+ specification_version: 1
4
+ name: ebay
5
+ version: !ruby/object:Gem::Version
6
+ version: 0.5.0
7
+ date: 2005-12-19 00:00:00 -08:00
8
+ summary: eBay4R is a Ruby wrapper for eBay's Web Services SOAP API. Emphasis is on ease of use and small footprint.
9
+ require_paths:
10
+ - lib
11
+ email: gdolley@ucla.edu
12
+ homepage: ebay4r.rubyforge.org
13
+ rubyforge_project:
14
+ description:
15
+ autorequire: eBayAPI
16
+ default_executable:
17
+ bindir: bin
18
+ has_rdoc: true
19
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
20
+ requirements:
21
+ - - ">"
22
+ - !ruby/object:Gem::Version
23
+ version: 0.0.0
24
+ version:
25
+ platform: ruby
26
+ signing_key:
27
+ cert_chain:
28
+ authors:
29
+ - Garry Dolley
30
+ files:
31
+ - examples/get_account2.rb
32
+ - examples/get_account3.rb
33
+ - examples/verify_add_item.rb
34
+ - examples/myCredentials.rb
35
+ - examples/hello_world.rb
36
+ - examples/get_account.rb
37
+ - examples/test.rb
38
+ - examples/get_item.rb
39
+ - examples/add_item.rb
40
+ - examples/get_feedback.rb
41
+ - lib/eBayAPI.rb
42
+ - lib/eBay.rb
43
+ - lib/RequesterCredentialsHandler.rb
44
+ - lib/eBayDriver.rb
45
+ - test/TODO
46
+ - test/tc_items.rb
47
+ - test/tc_hello_world.rb
48
+ - ./lib/.document
49
+ - README
50
+ test_files: []
51
+
52
+ rdoc_options: []
53
+
54
+ extra_rdoc_files:
55
+ - README
56
+ executables: []
57
+
58
+ extensions: []
59
+
60
+ requirements: []
61
+
62
+ dependencies: []
63
+