Skip to content

Commit

Permalink
Move negative failure message into query
Browse files Browse the repository at this point in the history
  • Loading branch information
jnicklas committed Jan 3, 2012
1 parent 18bc626 commit 362fbff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/capybara/query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ def failure_message(type, node)
message
end

def negative_failure_message(type, node)
"expected #{description} not to return anything"
end

def name; selector.name; end

def description
Expand Down
2 changes: 1 addition & 1 deletion lib/capybara/rspec/matchers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def failure_message_for_should
end

def failure_message_for_should_not
"expected #{query.description} not to return anything"
query.negative_failure_message(:assert, @actual)
end

def description
Expand Down

0 comments on commit 362fbff

Please sign in to comment.