Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

36 lines (27 sloc) 0.815 kb
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
Jump to Line
Something went wrong with that request. Please try again.