Sha256: 202775fd1185720308201f7baaae2adafeced77c459e8d48bd4f8b5cee083a11

Contents?: true

Size: 985 Bytes

Versions: 4

Compression:

Stored size: 985 Bytes

Contents

require 'test_helper'

module Vedeu

  module DSL

    describe Composition do

      let(:described) { Vedeu::DSL::Composition }
      let(:instance)  { described.new(model) }
      let(:model)     { Vedeu::Composition.new }
      let(:client)    {}

      describe '#initialize' do
        subject { instance }

        it { subject.must_be_instance_of(Vedeu::DSL::Composition) }
        it { subject.instance_variable_get('@model').must_equal(model) }
        it { subject.instance_variable_get('@client').must_equal(client) }
      end

      describe '#view' do
        subject {
          instance.view('dysprosium') do
            # ...
          end
        }

        it { subject.must_be_instance_of(Vedeu::Interfaces) }
        it { subject.first.must_be_instance_of(Vedeu::Interface) }

        context 'when the block is not given' do
          it { proc { instance.view }.must_raise(InvalidSyntax) }
        end
      end

    end # Composition

  end # DSL

end # Vedeu

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vedeu-0.3.3 test/lib/vedeu/dsl/composition_test.rb
vedeu-0.3.2 test/lib/vedeu/dsl/composition_test.rb
vedeu-0.3.1 test/lib/vedeu/dsl/composition_test.rb
vedeu-0.3.0 test/lib/vedeu/dsl/composition_test.rb