Sha256: 40e69d04323355088c03346d8bb5e1a99f523d89ade87f4267ee8e747a22218e
Contents?: true
Size: 1.07 KB
Versions: 31
Compression:
Stored size: 1.07 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' #Any global kernel API functions go here RSpec.describe "kern:global_function_spec" do include_context "kern" it "Can use the kern_log function which writes to kern_log_stdout" do #Compile the controller ctx = flok_new_user File.read('./spec/kern/assets/controller0.rb') dump = ctx.evald %{ kern_log("foo"); kern_log("bar"); dump.kern_log_stdout = kern_log_stdout; } expect(dump["kern_log_stdout"][0]).to eq("foo") expect(dump["kern_log_stdout"][1]).to eq("bar") end it "Can use the kern_log_json function which writes to kern_log_stdout" do #Compile the controller ctx = flok_new_user File.read('./spec/kern/assets/controller0.rb') dump = ctx.evald %{ kern_log_json({ "foo": "bar" }) dump.kern_log_stdout = kern_log_stdout; } expect(dump["kern_log_stdout"][0]).to eq({"foo" => "bar"}) end end
Version data entries
31 entries across 31 versions & 1 rubygems