Sha256: 45c217b239fadff49c7aa0ee5a943e29ec0898676b521dc36ddeffb0c768ee75

Contents?: true

Size: 1.66 KB

Versions: 19

Compression:

Stored size: 1.66 KB

Contents

require 'test_helper'

module Vedeu

  module DSL

    describe View do

      let(:described) { Vedeu::DSL::View }
      let(:instance)  { described.new(model, client) }
      let(:model)     {
        Vedeu::Views::View.new(name: 'actinium')
      }
      let(:client) {}

      describe '.renders' do
        subject {
          described.renders do
            # ...
          end
        }

        it { described.must_respond_to(:render) }
        it { subject.must_be_instance_of(Array) }

        context 'when the block is not given' do
          subject { described.renders }

          it { proc { subject }.must_raise(Vedeu::Error::RequiresBlock) }
        end

        context 'when the block is given' do
          it { subject.must_equal([]) }
        end
      end

      describe '.views' do
        subject {
          described.views do
            # ...
          end
        }

        it { subject.must_be_instance_of(Array) }

        context 'when the block is not given' do
          subject { described.views }

          it { proc { subject }.must_raise(Vedeu::Error::RequiresBlock) }
        end

        context 'when the block is given' do
          it { subject.must_equal([]) }
        end
      end

      describe '#lines' do
        subject {
          instance.lines do
            # ...
          end
        }

        it { subject.must_be_instance_of(Vedeu::Views::Lines) }

        context 'when the required block is not provided' do
          subject { instance.lines }

          it { proc { subject }.must_raise(Vedeu::Error::RequiresBlock) }
        end

        it { instance.must_respond_to(:line) }
      end

    end # View

  end # DSL

end # Vedeu

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
vedeu-0.6.31 test/lib/vedeu/dsl/view_test.rb
vedeu-0.6.30 test/lib/vedeu/dsl/view_test.rb
vedeu-0.6.29 test/lib/vedeu/dsl/view_test.rb
vedeu-0.6.28 test/lib/vedeu/dsl/view_test.rb
vedeu-0.6.27 test/lib/vedeu/dsl/view_test.rb
vedeu-0.6.26 test/lib/vedeu/dsl/view_test.rb
vedeu-0.6.25 test/lib/vedeu/dsl/view_test.rb
vedeu-0.6.24 test/lib/vedeu/dsl/view_test.rb
vedeu-0.6.23 test/lib/vedeu/dsl/view_test.rb
vedeu-0.6.22 test/lib/vedeu/dsl/view_test.rb
vedeu-0.6.21 test/lib/vedeu/dsl/view_test.rb
vedeu-0.6.20 test/lib/vedeu/dsl/view_test.rb
vedeu-0.6.19 test/lib/vedeu/dsl/view_test.rb
vedeu-0.6.18 test/lib/vedeu/dsl/view_test.rb
vedeu-0.6.17 test/lib/vedeu/dsl/view_test.rb
vedeu-0.6.16 test/lib/vedeu/dsl/view_test.rb
vedeu-0.6.15 test/lib/vedeu/dsl/view_test.rb
vedeu-0.6.14 test/lib/vedeu/dsl/view_test.rb
vedeu-0.6.13 test/lib/vedeu/dsl/view_test.rb