Skip to content

Commit

Permalink
Add spec to test async examples can fail before async block reached
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Nov 1, 2013
1 parent a95cd0b commit 03f5d2e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/async_spec.rb
Expand Up @@ -26,4 +26,14 @@
run_async { obj.should == [1, 2, 3, 4] }
end
end

async "should make example fail before async block reached" do
expect {
expect(:foo).to eq(:baz)
}.to raise_error(Exception)

set_timeout(0) do
run_async { expect(42).to eq(42) }
end
end
end

0 comments on commit 03f5d2e

Please sign in to comment.