$:.unshift File.dirname(__FILE__) + "/../../lib" require File.dirname(__FILE__) + "/../utils" require 'test/unit' require 'switchtower/scm/subversion' class ScmSubversionTest < Test::Unit::TestCase class SubversionTest < SwitchTower::SCM::Subversion attr_accessor :story attr_reader :last_path def svn_log(path) @last_path = path story.shift end end class MockChannel attr_reader :sent_data def send_data(data) @sent_data ||= [] @sent_data << data end def [](name) "value" end end class MockActor attr_reader :command attr_reader :channels attr_accessor :story def initialize(config) @config = config end def run(command) @command = command @channels ||= [] @channels << MockChannel.new story.each { |stream, line| yield @channels.last, stream, line } end def method_missing(sym, *args) @config.send(sym, *args) end end def setup @config = MockConfiguration.new @config[:repository] = "/hello/world" @config[:svn] = "/path/to/svn" @config[:password] = "chocolatebrownies" @scm = SubversionTest.new(@config) @actor = MockActor.new(@config) @log_msg = <