From 38f4486ecf5fbb28af7a2e269a514ff08b507fae Mon Sep 17 00:00:00 2001 From: mo k Date: Sat, 11 Feb 2012 13:57:13 -0700 Subject: add spec for when the book is for a different author. --- rakefile | 4 ++++ test/specifications/find_all_books_by_author_specs.rb | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/rakefile b/rakefile index 81322ae..732dbc3 100644 --- a/rakefile +++ b/rakefile @@ -1,3 +1,7 @@ task :test do sh "ruby -I lib:test test/ts_all.rb" end + +task :default => :test do + +end diff --git a/test/specifications/find_all_books_by_author_specs.rb b/test/specifications/find_all_books_by_author_specs.rb index 6e929e3..0252104 100644 --- a/test/specifications/find_all_books_by_author_specs.rb +++ b/test/specifications/find_all_books_by_author_specs.rb @@ -4,7 +4,6 @@ describe FindAllBooksByAuthor do before do @author = 'blah' @book = fake - @book.stub(:author).and_return(@author) @sut = FindAllBooksByAuthor.new(@author) end describe "when the book is by the author we are looking for" do @@ -12,7 +11,17 @@ describe FindAllBooksByAuthor do @result.must_equal true end before do + @book.stub(:author).and_return(@author) @result = @sut.is_satisfied_by?(@book) end end + describe "when the book is by another author" do + it "should return false" do + @result.must_equal false + end + before do + @book.stub(:author).and_return('another guy') + @result = @sut.is_satisfied_by? @book + end + end end -- cgit v1.2.3