cloudstack_ruby_client 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,9 +1,19 @@
1
1
  require 'bundler/gem_tasks'
2
2
  require 'rake/testtask'
3
3
 
4
- Rake::TestTask.new do |t|
5
- t.libs << 'test'
4
+ namespace :test do
5
+ desc 'Run integration tests'
6
+ Rake::TestTask.new(:integration) do |t|
7
+ t.libs << 'test/integration'
8
+ t.pattern = 'test/integration/*_test.rb'
9
+ end
10
+
11
+ Rake::TestTask.new(:unit) do |t|
12
+ t.libs << 'test/unit'
13
+ t.pattern = 'test/unit/*_test.rb'
14
+ end
6
15
  end
7
16
 
8
17
  desc 'Run tests'
18
+ task :test => Rake::Task["test:unit"]
9
19
  task :default => :test
@@ -35,9 +35,7 @@ class CloudstackRubyClient::BaseClient
35
35
  #http.use_ssl = @use_ssl
36
36
  #http.verify_mode = OpenSSL::SSL::VERIFY_NONE
37
37
  request = Net::HTTP::Get.new(uri.request_uri)
38
- puts 'sending!'
39
38
  response = http.request(request)
40
- puts 'got something'
41
39
  if !response.is_a?(Net::HTTPOK) then
42
40
  puts "Error #{response.code}: #{response.message}"
43
41
  puts JSON.pretty_generate(JSON.parse(response.body))
@@ -1,3 +1,3 @@
1
1
  module CloudstackRubyClient
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -7,8 +7,15 @@ class SampleTest < Test::Unit::TestCase
7
7
  APIKEY = 'yy0sfCPpyKnvREhgpeIWzXORIIvyteq_iCgFpKXnqpdbnHuoYiK78nprSggG4hcx-hxwW897nU-XvGB0Tq8YFw'
8
8
  SECKEY = 'Pse4fqYNnr1xvoRXlAe8NQKCSXeK_VGdwUxUzyLEPVQ7B3cI1Q7B8jmZ42FQpz2jIICFax1foIzg2716lJFZVw'
9
9
 
10
- def test_english_hello
10
+ def test_listNetworkOfferings
11
11
  client = CloudstackRubyClient::Client.new(URL, APIKEY, SECKEY, false)
12
- puts client.listNetworkOfferings()
12
+ client.listNetworkOfferings()
13
+ end
14
+
15
+ def test_badURL
16
+ client = CloudstackRubyClient::Client.new('http://192.168.56.10:8081/client/api', APIKEY, SECKEY, false)
17
+ assert_raise NoMethodError do
18
+ client.listNetworkOfferings()
19
+ end
13
20
  end
14
21
  end
@@ -0,0 +1,9 @@
1
+ require 'test/unit'
2
+
3
+ class EmptyTest < Test::Unit::TestCase
4
+
5
+ def test_empty
6
+ return nil
7
+ end
8
+
9
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Chip Childers
@@ -39,7 +39,8 @@ files:
39
39
  - lib/cloudstack_ruby_client/base_client.rb
40
40
  - lib/cloudstack_ruby_client/client.rb
41
41
  - lib/cloudstack_ruby_client/version.rb
42
- - test/test_client.rb
42
+ - test/integration/client_test.rb
43
+ - test/unit/empty_test.rb
43
44
  has_rdoc: true
44
45
  homepage: https://github.com/chipchilders/cloudstack_ruby_client
45
46
  licenses: []
@@ -71,4 +72,5 @@ signing_key:
71
72
  specification_version: 3
72
73
  summary: A Ruby client for CloudStack's API.
73
74
  test_files:
74
- - test/test_client.rb
75
+ - test/integration/client_test.rb
76
+ - test/unit/empty_test.rb