Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Retarded tests for Bob's accessors; fix directory

  • Loading branch information...
commit 8425c555f5dbd47379c5b8eea66ff18d9bfeceee 1 parent f3dfc5b
@sr sr authored
Showing with 26 additions and 2 deletions.
  1. +3 −1 Rakefile
  2. +1 −1  lib/bob.rb
  3. +22 −0 test/bob_test.rb
View
4 Rakefile
@@ -23,7 +23,9 @@ task :default => :test
SCMs = %w[git svn]
desc "Run unit tests"
-task :test => SCMs.map { |scm| "test:#{scm}" }
+task :test => SCMs.map { |scm| "test:#{scm}" } do
+ ruby "test/bob_test.rb"
+end
SCMs.each { |scm|
desc "Run unit tests with #{scm}"
View
2  lib/bob.rb
@@ -20,7 +20,7 @@ def self.build(buildable, commit_ids)
# Directory where the code for the different buildables will be checked out. Make sure
# the user running Bob is allowed to write to this directory.
def self.directory
- @checkout_directory || "/tmp"
+ @directory || "/tmp"
end
# What will you use to build in background. Must respond to <tt>call</tt> and take a block
View
22 test/bob_test.rb
@@ -0,0 +1,22 @@
+require File.dirname(__FILE__) + "/helper"
+
+class BobTest < Test::Unit::TestCase
+ test "directory" do
+ Bob.directory = "/foo/bar"
+ assert_equal "/foo/bar", Bob.directory
+ end
+
+ test "logger" do
+ logger = Logger.new("/tmp/bob.log")
+ Bob.logger = logger
+
+ assert_same logger, Bob.logger
+ end
+
+ test "engine" do
+ engine = Object.new
+ Bob.engine = engine
+
+ assert_same engine, Bob.engine
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.