Sha256: 735f63c11720d42d3fc30d74e63c4d4056dd79ccd94bf585c835d432729373f7

Contents?: true

Size: 1.34 KB

Versions: 1

Compression:

Stored size: 1.34 KB

Contents

require 'test_helper'

module Vedeu

  describe Clear do

    let(:described) { Vedeu::Clear }
    let(:instance)  { described.new(interface, options) }
    let(:interface) { Vedeu::Interface.new(name: 'xenon', visible: visible) }
    let(:options)   {
      {

      }
    }
    let(:geometry)  { Vedeu::Geometry.new(x: 1, y: 1, xn: 3, yn: 3)}
    let(:visible)   { true }

    before { interface.stubs(:geometry).returns(geometry) }

    describe '#initialize' do
      it { instance.must_be_instance_of(Vedeu::Clear) }
      it { instance.instance_variable_get('@interface').must_equal(interface) }
      it { instance.instance_variable_get('@options').must_equal(options) }
    end

    describe 'alias methods' do
      it { described.must_respond_to(:render) }
    end

    describe '.clear' do
      subject { described.clear(interface, options) }

      context 'when the interface is visible' do

      end

      context 'when the interface is not visible' do
        let(:visible) { false }

        it { subject.must_be_instance_of(Array) }

        it { subject.must_equal([]) }
      end
    end

    describe '#clear' do
      subject { instance.clear }

      it { subject.must_be_instance_of(Array) }
      it { subject.flatten.size.must_equal(9) }
    end

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

  end # Clear

end # Vedeu

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vedeu-0.4.14 test/lib/vedeu/output/clear_test.rb