Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Failing test - on_request hook #432

Closed
jamonholmgren opened this Issue · 3 comments

2 participants

@jamonholmgren

https://github.com/clearsightstudio/ProMotion/blob/edge/spec/unit/web_spec.rb#L37-L45

    it "should called on_request hook" do
      @webscreen.open_url(NSURL.URLWithString('http://mixi.jp/'))

      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?://.*|
      end
    end

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 jamonholmgren added the bug label
@ainame

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

@ainame

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
261 specifications (462 requirements), 0 failures, 0 errors

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.