Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/rspec_tapas/matchers/have_table_row.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ module Matchers
@failure_message
end

failure_message_when_negated do |_actual|
"Expected not to find table row #{expected} but found"
end

private

def with_delay
Expand Down
4 changes: 4 additions & 0 deletions spec/rspec_tapas/matchers/have_table_row_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
expect(page).to have_table_row(0 => 'John', 1 => 27)
expect(page).to have_table_row('John', 27)
expect(page).to have_table_row(have_content('oh'), 27)

expect do
expect(page).not_to have_table_row('Name' => 'John', 'Age' => 27)
end.to fail_with('Expected not to find table row {"Name"=>"John", "Age"=>27} but found')
end
end

Expand Down