Skip to content

Commit 62d6d0f

Browse files
author
Ben Miller
committed
changes needed to run tests with a fresh install
* fixes several missing dependencies / deprecation warnings * the specs do not run with test/unit or without minitest/autorun * use bundler to ensure correct gem versions are used during testing
1 parent 50b6544 commit 62d6d0f

5 files changed

Lines changed: 9 additions & 7 deletions

File tree

README.textile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Have fun and let me know what needs to be fixed / added.
7272
== Testing
7373
You can invoke a series of minitest based spec test using the supplied
7474
tests and rake task. Simply run the following to kick off the tests
75-
@rake test@
75+
@bundle exec rake test@
7676

7777
You should see output similar to the following (The number of tests will
7878
of course grow over time):

Rakefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
require 'rubygems'
22
require 'rake/clean'
3-
require 'rake/gempackagetask'
4-
require 'rake/rdoctask'
3+
require 'rubygems/package_task'
4+
require 'rdoc/task'
55
require 'rake/testtask'
6+
require 'date'
67

78
CLEAN.include("pkg")
89
CLEAN.include("doc")
@@ -33,8 +34,8 @@ GEMSPEC = Gem::Specification.new do |gem|
3334
gem.add_runtime_dependency 'tzinfo'
3435
gem.post_install_message = "See README.rdoc"
3536
end
36-
37-
Rake::GemPackageTask.new(GEMSPEC) do |pkg|
37+
38+
Gem::PackageTask.new(GEMSPEC) do |pkg|
3839
pkg.need_tar = true
3940
end
4041

test/test_helper.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
$:.unshift File.join(File.dirname(__FILE__),'..','lib')
22
#http://net.tutsplus.com/tutorials/ruby/ruby-for-newbies-testing-with-rspec/
33
require_relative '../lib/zenoss'
4-
require 'test/unit'
54

65

76
ZENOSS_URL = ENV['zenoss_client_url'] || "http://localhost:8080/zport/dmd"

test/zenoss_client_test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
require_relative './test_helper'
22
require 'minitest/spec'
3+
require 'minitest/autorun'
34
require 'logger'
45

56
LOG = Logger.new(STDOUT)

zenoss_client.gemspec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Gem::Specification.new do |gem|
3131
gem.add_runtime_dependency 'httpclient', '~> 2.2.0'
3232
gem.add_runtime_dependency 'tzinfo', '~> 0.3.20'
3333
gem.add_runtime_dependency 'json', '~> 1.5'
34-
34+
35+
gem.add_development_dependency('rake')
3536
gem.add_development_dependency('minitest')
3637
end

0 commit comments

Comments
 (0)