spec/dom/document_spec.rb in opal-browser-0.2.0 vs spec/dom/document_spec.rb in opal-browser-0.3.0

- old
+ new

@@ -37,24 +37,26 @@ expect($document["doo-dah"]).to be_nil end end describe "#ready" do - async "calls the block when the document is ready" do + it "calls the block when the document is ready" do + promise = Browser::Promise.new $document.ready do - async { - expect(true).to be_truthy - } + expect(true).to be_truthy + promise.resolve end + promise.for_rspec end end describe "#ready?" do - async "is true inside a #ready block" do + it "is true inside a #ready block" do + promise = Browser::Promise.new $document.ready do - async { - expect($document.ready?).to be_truthy - } + expect($document.ready?).to be_truthy + promise.resolve end + promise.for_rspec end end end