Sha256: 26b4582f37a1650ab873fc6d5cc9e6d085c52356d9c1ca68a69dba7b561b6163

Contents?: true

Size: 498 Bytes

Versions: 2

Compression:

Stored size: 498 Bytes

Contents

require 'spec_helper'
module WLang
  class Scope
    describe ProcScope do

      it 'implements fetch through call.xxx' do
        scope = Scope.coerce(lambda{ {:who => "World"} })
        scope.fetch(:who).should eq("World")
      end

      it 'delegates fetch to its parent when not found' do
        scope = Scope.coerce(lambda{ nil }, Scope.coerce({:who => "World"}))
        scope.fetch(:who).should eq("World")
      end

    end # describe ProcScope
  end # class Scope
end # module WLang

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wlang-2.0.1 spec/unit/scope/test_proc_scope.rb
wlang-2.0.0 spec/unit/scope/test_proc_scope.rb