Sha256: 1b75d69b5f565bffc1db5ac3a0a099ceca4cbeafedf540b0fe6295440929fbca

Contents?: true

Size: 541 Bytes

Versions: 12

Compression:

Stored size: 541 Bytes

Contents

require 'spec_helper'
module WLang
  describe Dialect, 'context' do

    let(:dialect){ Dialect.new }

    subject{ dialect.context }

    it 'defaults to nil if no scope' do
      subject.should be_nil
    end

    it "is the scope's subject when one scope" do
      dialect.with_scope(:x) do
        subject.should eq(:x)
      end
    end

    it "is the root scope's subject when multiple scope" do
      dialect.with_scope(:x) do
        dialect.with_scope(:y) do
          subject.should eq(:x)
        end
      end
    end

  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

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