Sha256: 7b4d51a868769c12002b1a3cd82ddab622729dfd023b62aaea555b2f12563125

Contents?: true

Size: 589 Bytes

Versions: 6

Compression:

Stored size: 589 Bytes

Contents

require 'spec_helper'

describe Compositor::DSL do

  let(:context) { Object.new }

  describe '#empty' do
    it 'returns the default type' do
      dsl = Compositor::DSL.create(context) do
      end

      nil.should == dsl.to_hash
    end
  end

  describe 'instance variables' do
    it 'allows instance variables from the view context to be accessed in the dsl evaluation' do
      context.instance_eval do
        @blah = 1
      end

      Compositor::DSL.create(context) do
        raise "Instance variable should be available in DSL" unless @blah == 1
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
compositor-2.0.1 spec/compositor/dsl_spec.rb
compositor-2.0.0 spec/compositor/dsl_spec.rb
compositor-1.0.1 spec/compositor/dsl_spec.rb
compositor-1.0.0 spec/compositor/dsl_spec.rb
compositor-0.1.4 spec/compositor/dsl_spec.rb
compositor-0.1.3 spec/compositor/dsl_spec.rb