summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo k <mo@mokhan.ca>2012-02-11 13:57:13 -0700
committermo k <mo@mokhan.ca>2012-02-11 13:57:13 -0700
commit38f4486ecf5fbb28af7a2e269a514ff08b507fae (patch)
tree8b33899506995290d788f9a0f786333f48d23b4b
parent5e64558fe2827eccb312952aea0539249dfb53f6 (diff)
add spec for when the book is for a different author.
-rw-r--r--rakefile4
-rw-r--r--test/specifications/find_all_books_by_author_specs.rb11
2 files changed, 14 insertions, 1 deletions
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