Sha256: b91fc84b73eb2e0b33e1bdf8aa1a8e81c70ebdea341ddfc7e1d5708b586cdd6f

Contents?: true

Size: 1.26 KB

Versions: 69

Compression:

Stored size: 1.26 KB

Contents

Dir.chdir File.join File.dirname(__FILE__), '../../'
require './spec/env/kern.rb'
require './spec/lib/helpers.rb'
require './spec/lib/io_extensions.rb'
require './spec/lib/rspec_extensions.rb'

#The debug controller / ui spec

RSpec.describe "kern:debug_spec" do
  include_context "kern"

  #includes context, events, etc.
  it "Can retreive the controller's describe" do
    #Compile the controller
    ctx = flok_new_user File.read('./spec/kern/assets/controller_describe.rb')

    #Do not run anything
    ctx.eval %{
      //Call embed on main root view
      base = _embed("my_controller", 0, {}, null);

      //Drain queue
      int_dispatch([]);
    }

    base = ctx.eval("base")

    @driver.mexpect("if_init_view", ["my_controller", {}, base+1, ["main"]])
    @driver.mexpect("if_controller_init", [base, base+1, "my_controller", {"hello" => "world"}])
    @driver.mexpect("if_attach_view", [base+1, 0])
    @driver.mexpect("if_event", [base, "action", {"from" => nil, "to" => "index"}])

    #Request context for view controller
    @driver.int "int_debug_controller_describe", [base]
    @driver.mexpect("if_event", [-333, "debug_controller_describe_res", {
      "context" => {
        "hello" => "world"
      },
      "events" => [
        "test"
      ]
    }])
  end
end

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
flok-0.0.105 spec/kern/debug_spec.rb
flok-0.0.103 spec/kern/debug_spec.rb
flok-0.0.102 spec/kern/debug_spec.rb
flok-0.0.101 spec/kern/debug_spec.rb
flok-0.0.100 spec/kern/debug_spec.rb
flok-0.0.99 spec/kern/debug_spec.rb
flok-0.0.98 spec/kern/debug_spec.rb
flok-0.0.97 spec/kern/debug_spec.rb
flok-0.0.96 spec/kern/debug_spec.rb
flok-0.0.95 spec/kern/debug_spec.rb
flok-0.0.94 spec/kern/debug_spec.rb
flok-0.0.93 spec/kern/debug_spec.rb
flok-0.0.92 spec/kern/debug_spec.rb
flok-0.0.91 spec/kern/debug_spec.rb
flok-0.0.90 spec/kern/debug_spec.rb
flok-0.0.89 spec/kern/debug_spec.rb
flok-0.0.88 spec/kern/debug_spec.rb
flok-0.0.87 spec/kern/debug_spec.rb
flok-0.0.86 spec/kern/debug_spec.rb
flok-0.0.85 spec/kern/debug_spec.rb