Skip to content

Commit

Permalink
Adding Browser#remove_listener to enable removing a listener block.
Browse files Browse the repository at this point in the history
This is needed so Culerity can implement Browser#confirm locally.
  • Loading branch information
caius committed Sep 21, 2009
1 parent 3a5d7bb commit 614d4ee
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spec/browser_spec.rb
Expand Up @@ -277,6 +277,15 @@
output.should include('Dubito, ergo cogito, ergo sum')
end
end

describe "#remove_listener" do
it "should remove the listener" do
@browser.goto(HTML_DIR + "/forms_with_input_elements.html")
@browser.add_listener(:confirm) { }
@browser.remove_listener(:confirm) { }
@browser.execute_script("confirm()").should != true
end
end


describe "#confirm" do
Expand Down

0 comments on commit 614d4ee

Please sign in to comment.