Skip to content

Commit

Permalink
fix case where a context with no expects blocks explodes
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgolick committed Jan 16, 2009
1 parent 8411ede commit d0f8815
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/zebra/shoulda.rb
Expand Up @@ -34,7 +34,7 @@ def create_test_from_expect(&block)
end

def build_with_expects
expects.each { |e| create_test_from_expect(&e) }
(expects || []).each { |e| create_test_from_expect(&e) }
build_without_expects
end
end
Expand Down
6 changes: 6 additions & 0 deletions test/shoulda/shoulda_test.rb
Expand Up @@ -17,4 +17,10 @@ def setup
assert self.respond_to?("test: in a context expect true"), self.class.instance_methods.grep(/test/).inspect
end
end

context "A context with no expects" do
should "not raise any exceptions" do
true
end
end
end

0 comments on commit d0f8815

Please sign in to comment.