Sha256: bde2a1eb0cc3445a660afae1799ca7a8c0d051aebacf9896096a4da4a3b5cc5b

Contents?: true

Size: 815 Bytes

Versions: 12

Compression:

Stored size: 815 Bytes

Contents

require 'spec_helper'
module WLang
  class Scope
    describe NullScope do

      let(:scope){ NullScope.new }

      it 'throws on fetch' do
        lambda{ scope.fetch(:who) }.should throw_symbol(:fail)
      end

      it 'throws on fetch even on `self`' do
        lambda{ scope.fetch(:self) }.should throw_symbol(:fail)
      end

      it 'returns pushed scope on push' do
        pushed = ObjectScope.new(12)
        scope.push(pushed).should eq(pushed)
      end

      it 'coerces pushed scope on push' do
        scope.push(12).should be_a(ObjectScope)
      end

      it 'returns nil on pop' do
        scope.pop.should be_nil
      end

      it 'returns an empty array of subjects' do
        scope.subjects.should eq([])
      end

    end # describe NullScope
  end # class Scope
end # module WLang

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
wlang-3.0.1 spec/unit/scope/test_null_scope.rb
wlang-3.0.0 spec/unit/scope/test_null_scope.rb
wlang-2.3.1 spec/unit/scope/test_null_scope.rb
wlang-2.3.0 spec/unit/scope/test_null_scope.rb
wlang-2.2.4 spec/unit/scope/test_null_scope.rb
wlang-2.2.3 spec/unit/scope/test_null_scope.rb
wlang-2.2.2 spec/unit/scope/test_null_scope.rb
wlang-2.2.1 spec/unit/scope/test_null_scope.rb
wlang-2.2.0 spec/unit/scope/test_null_scope.rb
wlang-2.1.2 spec/unit/scope/test_null_scope.rb
wlang-2.1.1 spec/unit/scope/test_null_scope.rb
wlang-2.1.0 spec/unit/scope/test_null_scope.rb