Sha256: 62444bfdf7d1aa79ddd71500e66f62a0f84e8105632e3cfb8d10f28ed7239104

Contents?: true

Size: 1.18 KB

Versions: 30

Compression:

Stored size: 1.18 KB

Contents

#The dummy pager

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

RSpec.describe "kern:dummy_pager" do
  include Zlib
  include_context "kern"

  it "Writes to the dummy pager end up in the pg_dummyN_write_vm_cache_clone array" do
    ctx = flok_new_user File.read('./spec/kern/assets/vm/pg_dummy/controller0.rb'), File.read("./spec/kern/assets/vm/pg_dummy/config.rb") 
    dump = ctx.evald %{
      dump.base = _embed("my_controller", 0, {}, null);

      //Drain queue
      int_dispatch([]);

      dump.pg_dummy0_write_vm_cache_clone = pg_dummy0_write_vm_cache_clone;
    }

    #Should be empty at first
    expect(dump["pg_dummy0_write_vm_cache_clone"]).to eq([])

    @driver.int "int_event", [
      dump["base"],
      "do_write",
      {}
    ]

    #Should have gotten the write request and cloned the vm_cache
    pg_dummy0_write_vm_cache_clone = ctx.dump "pg_dummy0_write_vm_cache_clone"
    expect(pg_dummy0_write_vm_cache_clone.length).to eq(1)
    expect(pg_dummy0_write_vm_cache_clone[0]["dummy"]["lol"]["_id"]).to eq("lol")
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

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