Commit 4726104b29feb176c1cfc9945464f22c7357f25c
- Date: Sat Oct 13 01:26:26 +0000 2007
- Committer: fbos (fbos@d6c2ea82-c31b-0410-8381-e9c44f9824c5)
- Author: fbos (fbos@d6c2ea82-c31b-0410-8381-e9c44f9824c5)
- Commit SHA1: 4726104b29feb176c1cfc9945464f22c7357f25c
- Tree SHA1: a5dbe2056a8e6a30c789eddeaff2b4508c03160c
Corrected failing specifications.
git-svn-id: svn+ssh://rubyforge.org/var/svn/piston/trunk@136 d6c2ea82-c31b-0410-8381-e9c44f9824c5
Commit diff
| |   |
| 18 | 18 | it "should report it does not exist when used on a repository which does not exist" do |
| 19 | 19 | Piston::Repository.new("file:///path/to/some/repos").should_not exist |
| 20 | 20 | end |
| 21 | | |
| 22 | | it "should report it exists when used on a repository which was created" do |
| 23 | | @repos = Piston::Repository.new("file://#{File.expand_path(File.dirname(__FILE__))}/tmp/repos") |
| 24 | | @repos.create! |
| 25 | | @repos.should exist |
| 26 | | end |
| 27 | 21 | end |
| 28 | 22 | |
| 29 | 23 | describe Piston::Repository, "with a file:/// URL" do |
| 30 | 24 | it_should_behave_like "A local repository" |
| 31 | 25 | |
| 26 | it "should report it exists when used on a repository which was created" do |
| 27 | @repos.should exist |
| 28 | end |
| 29 | |
| 32 | 30 | it "should create the repository on-disk" do |
| 33 | | @repos.create! |
| 34 | 31 | File.directory?(@repos_dir).should == true |
| 35 | 32 | end |
| 36 | 33 | |
| 37 | 34 | it "should raise an exception if the directory already exists" do |
| 38 | | @repos.create! |
| 39 | 35 | lambda { @repos.create! }.should raise_error(Piston::Repository::DirectoryAlreadyExists) |
| 40 | 36 | end |
| 41 | | |
| 42 | | it "should return self from #create!" do |
| 43 | | @repos.create!.should == @repos |
| 44 | | end |
| 45 | 37 | end |
| 46 | 38 | |
| 47 | 39 | describe Piston::Repository, "with a newly created local repository" do |
| 48 | 40 | it_should_behave_like "A local repository" |
| 49 | 41 | |
| 50 | | before do |
| 51 | | @repos.create! |
| 52 | | end |
| 53 | | |
| 54 | 42 | it "should report the current revision number" do |
| 55 | 43 | @repos.youngest.should == 0 |
| 56 | 44 | end |
| toggle raw diff |
--- a/spec/repository_spec.rb
+++ b/spec/repository_spec.rb
@@ -18,39 +18,27 @@ describe Piston::Repository do
it "should report it does not exist when used on a repository which does not exist" do
Piston::Repository.new("file:///path/to/some/repos").should_not exist
end
-
- it "should report it exists when used on a repository which was created" do
- @repos = Piston::Repository.new("file://#{File.expand_path(File.dirname(__FILE__))}/tmp/repos")
- @repos.create!
- @repos.should exist
- end
end
describe Piston::Repository, "with a file:/// URL" do
it_should_behave_like "A local repository"
+ it "should report it exists when used on a repository which was created" do
+ @repos.should exist
+ end
+
it "should create the repository on-disk" do
- @repos.create!
File.directory?(@repos_dir).should == true
end
it "should raise an exception if the directory already exists" do
- @repos.create!
lambda { @repos.create! }.should raise_error(Piston::Repository::DirectoryAlreadyExists)
end
-
- it "should return self from #create!" do
- @repos.create!.should == @repos
- end
end
describe Piston::Repository, "with a newly created local repository" do
it_should_behave_like "A local repository"
- before do
- @repos.create!
- end
-
it "should report the current revision number" do
@repos.youngest.should == 0
end
|