Permalink
Browse files

Added rake tasks for specing garlic

Added some more tiny specs
  • Loading branch information...
1 parent 840fdd6 commit ce59ab074f2ab4df56eeae8515eaa2ddbaeb1654 @ianwhite committed Apr 26, 2008
Showing with 22 additions and 1 deletion.
  1. +9 −0 Rakefile
  2. +13 −1 spec/garlic/repo_spec.rb
View
9 Rakefile
@@ -0,0 +1,9 @@
+task :default => :spec
+
+task :spec do
+ cd('spec') { sh 'spec *' }
+end
+
+task :specdoc do
+ cd('spec') { puts `spec * -f specdoc` }
+end
View
14 spec/garlic/repo_spec.rb
@@ -1,7 +1,7 @@
require File.expand_path(File.join(File.dirname(__FILE__), '../spec_helper'))
describe Garlic::Repo do
- describe "new(:url => 'some/url', :path => 'some/path')" do
+ describe "new(:url => 'some/local/repo', :path => 'some/dest')" do
before { @repo = Garlic::Repo.new(:url => 'some/local/repo', :path => 'some/dest') }
it "should expand the path" do
@@ -17,10 +17,22 @@
end
describe '#install' do
+ before do
+ @repo.stub!(:puts) # silence!
+ end
+
it "should 'git clone <repo> <dest>" do
@repo.should_receive(:sh).with("git clone #{@repo.url} #{@repo.path}")
@repo.install
end
end
end
+
+ describe "new(:url => 'git://remote/repo', :path => 'some/dest')" do
+ before { @repo = Garlic::Repo.new(:url => 'git://remote/repo', :path => 'some/dest') }
+
+ it "should NOT expand the url" do
+ @repo.url == 'git://remote/repo'
+ end
+ end
end

0 comments on commit ce59ab0

Please sign in to comment.