Failing test - on_request hook #432

jamonholmgren opened this Issue Feb 27, 2014 · 3 comments


None yet
2 participants

jamonholmgren commented Feb 27, 2014

    it "should called on_request hook" do

      wait_for_change @webscreen, 'on_request' do
        @webscreen.on_request_args[0].is_a?(NSURLRequest).should == true
        # on_request is called when @webscreen request for some iframe
        @webscreen.on_request_args[0].URL.absoluteString.should =~ %r|https?://.*|

This test consistently fails in master and edge for me.

when use on_request hook by web brigde rpc
  - should called on_request hook
 [✗] This test has not passed: FAILED - true.!() failed!
 [FAILED - true.!() failed]
 BACKTRACE: Bacon::Error: true.!() failed
    spec.rb:698:in `satisfy:': when use on_request hook by web brigde rpc - should called on_request hook
    spec.rb:712:in `method_missing:'
    spec.rb:438:in `execute_block'
    spec.rb:402:in `run_postponed_block:'

@ainame , you wrote this test, any ideas?

jamonholmgren added the bug label Feb 27, 2014


ainame commented Mar 1, 2014

Huum, I'll check it, but i don't know recently updates of ProMotion and RubyMotion.


ainame commented Mar 2, 2014

In spec/helpers/web_screen.rb, TestWebScreen implement load_finished method as a not only hook of PM::WebScreen but also as attr_accessor.

It should maybe invalid, because load_finished method have two roles.

  1. implementation of hook
  2. checking of changes for loading status.

Then, it maybe success spec by chance in early rubymotion or promotion environment.

I will create a pull request for this issue to separate to two method for those.


jamonholmgren commented Mar 3, 2014

261 specifications (462 requirements), 0 failures, 0 errors


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment