0
require File.dirname(__FILE__) + "/../../test_helper"
0
class TestWorkingCopyInfo < Test::Unit::TestCase
0
- GIT_VALUES = {"format"=>1, "handler"=>{"commit"=>"db9c7bddaa9c54bff48d64c56db2f89b2bcfa049"}, "repository_url"=>"git://gitorious.org/git-tmbundle/mainline.git", "lock"=>false, "repository_class"=>"Piston::Git::Repository"}
0
- SVN_VALUES = {"format"=>1, "handler"=>{"piston:remote-revision"=>9250, "piston:uuid"=>"5ecf4fe2-1ee6-0310-87b1-e25e094e27de"}, "repository_url"=>"http://dev.rubyonrails.org/svn/rails/plugins/ssl_requirement", "lock"=>nil, "repository_class"=>"Piston::Svn::Repository"}
0
- wcdir = Pathname.new("tmp/wc")
0
- wcdir.rmtree rescue nil
0
- @wc = Piston::WorkingCopy.new(wcdir)
0
+ @path = Pathname.new("tmp/wc")
0
+ @wc = Piston::WorkingCopy.new(@path)
0
- def test_info_when_is_git_repository
0
- @wc.expects(:recall).returns(GIT_VALUES)
0
- assert_equal "+---------------------------Piston Info----------------------------------+\nDirectory: tmp/wc\nRepository type: Git\nRepository: git://gitorious.org/git-tmbundle/mainline.git\nCommit: db9c7bddaa9c54bff48d64c56db2f89b2bcfa049\nLock: false\n+------------------------------------------------------------------------+", @wc.info
0
+ def test_info_recalls_values
0
+ @wc.expects(:recall).returns(values = mock("recalled values"))
0
+ assert_equal values, @wc.info
0
- def test_info_when_is_svn_repository
0
- @wc.expects(:recall).returns(SVN_VALUES)
0
- assert_equal "+---------------------------Piston Info----------------------------------+\nDirectory: tmp/wc\nRepository type: Svn\nRepository: http://dev.rubyonrails.org/svn/rails/plugins/ssl_requirement\nRemote Revision: 9250\nLock: \n+------------------------------------------------------------------------+", @wc.info
Comments
No one has commented yet.