Sha256: c4e21c79d8311feda80a7ffdf811151617269a490389706e05d3301233ba50cc

Contents?: true

Size: 858 Bytes

Versions: 2

Compression:

Stored size: 858 Bytes

Contents

require 'test_helper'

module Vedeu
  module API
    describe Composition do
      describe '#view' do
      end

      describe '#views' do
        it 'allows multiple views to be defined at once' do
          attrs = Vedeu.views do
            view 'view_1' do
              line do
                text '1. A line of text in view 1.'
                text '2. Another line of text in view 1.'
              end
            end
            view 'view_2' do
              line do
                text '1. A line of text in view 2.'
                text '2. Another line of text in view 2.'
              end
            end
          end
          attrs[:interfaces].size.must_equal(2)
        end

        it 'raises an exception when a block is not given' do
          proc { Vedeu.views }.must_raise(InvalidSyntax)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vedeu-0.2.0 test/lib/vedeu/api/composition_test.rb
vedeu-0.1.19 test/lib/vedeu/api/composition_test.rb