Skip to content

Commit

Permalink
Add ShoesSpec failure test
Browse files Browse the repository at this point in the history
  • Loading branch information
noahgibbs committed Jul 20, 2024
1 parent 12a42c3 commit 0319a2f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/cache/sspec_fail.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<script type="module" src="spacewalk.js"></script>
<script type="text/ruby">
Shoes.app do
@b = button "OK"
end
</script>
<script type="text/shoes-spec">
assert false, "This is supposed to fail"
</script>
</head>
<body>
</body>
</html>
10 changes: 10 additions & 0 deletions test/test_shoes_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,14 @@ def test_basic_sspec_test_succeeds
assert_equal true, result
end
end

def test_basic_sspec_test_fails
with_app("/sspec_fail.html") do
assert_selector("div.minitest_result", wait: 5)
result = page.evaluate_script('document.shoes_spec.passed')
assert_equal false, result, "A test failure should return a false result for shoes_spec.passed"
fails = page.evaluate_script('document.shoes_spec.failures')
assert_equal 1, fails, "Should see one failure, not #{fails.inspect}"
end
end
end

0 comments on commit 0319a2f

Please sign in to comment.