aboutsummaryrefslogtreecommitdiffstats
path: root/switchtower/test
diff options
context:
space:
mode:
Diffstat (limited to 'switchtower/test')
-rw-r--r--switchtower/test/configuration_test.rb4
-rw-r--r--switchtower/test/scm/cvs_test.rb7
2 files changed, 7 insertions, 4 deletions
diff --git a/switchtower/test/configuration_test.rb b/switchtower/test/configuration_test.rb
index 2ec299ab6d..ecbc0a5607 100644
--- a/switchtower/test/configuration_test.rb
+++ b/switchtower/test/configuration_test.rb
@@ -18,7 +18,6 @@ class ConfigurationTest < Test::Unit::TestCase
class MockSCM
attr_reader :configuration
- attr_accessor :latest_revision
def initialize(config)
@configuration = config
@@ -184,8 +183,7 @@ class ConfigurationTest < Test::Unit::TestCase
def test_release_path_implicit
@config.set :deploy_to, "/start/of/path"
- @config.source.latest_revision = 2257
- assert_equal "/start/of/path/releases/2257", @config.release_path
+ assert_equal "/start/of/path/releases/#{@config.now.strftime("%Y%m%d%H%M%S")}", @config.release_path
end
def test_release_path_explicit
diff --git a/switchtower/test/scm/cvs_test.rb b/switchtower/test/scm/cvs_test.rb
index 3df64cce0e..4532870826 100644
--- a/switchtower/test/scm/cvs_test.rb
+++ b/switchtower/test/scm/cvs_test.rb
@@ -44,6 +44,10 @@ class ScmCvsTest < Test::Unit::TestCase
story.each { |stream, line| yield @channels.last, stream, line }
end
+ def release_path
+ (@config[:now] || Time.now.utc).strftime("%Y%m%d%H%M%S")
+ end
+
def method_missing(sym, *args)
@config.send(sym, *args)
end
@@ -55,6 +59,7 @@ class ScmCvsTest < Test::Unit::TestCase
@config[:local] = "/hello/world"
@config[:cvs] = "/path/to/cvs"
@config[:password] = "chocolatebrownies"
+ @config[:now] = Time.utc(2005,8,24,12,0,0)
@scm = CvsTest.new(@config)
@actor = MockActor.new(@config)
@log_msg = <<MSG.strip
@@ -140,7 +145,7 @@ MSG
def test_latest_revision
@scm.story = [ @log_msg ]
- assert_equal "2004-10-12T02:21:02", @scm.latest_revision
+ assert_equal "2004-10-12 02:21:02", @scm.latest_revision
assert_equal "/hello/world", @scm.last_path
end