test/unit/svn_test.rb in vigetlabs-provisional-2.1.2 vs test/unit/svn_test.rb in vigetlabs-provisional-2.1.3

- old
+ new

@@ -2,21 +2,20 @@ require File.dirname(__FILE__) + '/../../lib/provisional/scm/svn' class SvnTest < Test::Unit::TestCase def setup - @scm = Provisional::SCM::Svn.new( - { - 'name' => 'name', - 'template_path' => 'template_path', - 'url' => 'url', - 'username' => 'username', - 'password' => 'password' - } - ) + @scm = new_scm(Provisional::SCM::Svn, { 'url' => 'url' }) end + # FIXME: implement this + def test_gitignore + assert_raise NotImplementedError do + @scm.gitignore + end + end + def test_init assert_raise NotImplementedError do @scm.init end end @@ -25,25 +24,17 @@ @scm.expects(:system).with("svn co --username=username --password=password url name") Dir.expects(:chdir).with('name') %w(branches tags trunk).each {|d| Dir.expects(:mkdir).with(d)} @scm.expects(:system).with("svn add branches tags trunk") @scm.expects(:system).with("svn commit -m 'Structure by Provisional'") - Dir.expects(:chdir).with('trunk') - Rails::Generator::Base.expects(:use_application_sources!) - generator_stub = stub() - generator_stub.expects(:run).with(%w(. -m template_path), :generator => 'app') - Rails::Generator::Scripts::Generate.expects(:new).returns(generator_stub) + Provisional::RailsApplication.expects(:new) @scm.generate_rails end def test_generate_rails_can_optionally_skip_svn_structure_creation @scm.expects(:system).with("svn co --username=username --password=password url name") Dir.expects(:chdir).with('name') - Dir.expects(:chdir).with('trunk') - Rails::Generator::Base.expects(:use_application_sources!) - generator_stub = stub() - generator_stub.expects(:run).with(%w(. -m template_path), :generator => 'app') - Rails::Generator::Scripts::Generate.expects(:new).returns(generator_stub) + Provisional::RailsApplication.expects(:new) @scm.generate_rails(false) end def test_generate_rails_should_raise_RuntimeError_if_any_step_raises_any_exception @scm.expects(:system).with("svn co --username=username --password=password url name")