Sha256: d355d297ccdf33953ac17cafde291db52ee4cfd7719ca7022653c839bf2f2107
Contents?: true
Size: 884 Bytes
Versions: 31
Compression:
Stored size: 884 Bytes
Contents
require 'spec_helper' module Startback describe Context, "fork" do it 'is a simple dup without args' do context = SubContext.new context.foo = ['hello'] forked = context.fork expect(forked).not_to be(context) expect(forked.foo).to eql(['hello']) expect(forked.foo).to be(context.foo) end it 'yields the context if a block is provided' do context = SubContext.new seen = false context.fork({ 'foo' => 'hello' }) do |forked| expect(forked).not_to be(context) expect(forked.foo).to eql('hello') seen = true end expect(seen).to eql(true) end it 'uses the factory on the hash provided' do context = SubContext.new forked = context.fork({ 'foo' => 'hello' }) expect(forked).not_to be(context) expect(forked.foo).to eql('hello') end end end
Version data entries
31 entries across 31 versions & 3 rubygems