Sha256: 8215d33192dc01543cc9e0215c8846e1320798f9de2f34df2f6d57d62aca3441

Contents?: true

Size: 1.79 KB

Versions: 2

Compression:

Stored size: 1.79 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(:visible)   { true }
    let(:drb)       { false }

    before do
      Vedeu::Border.new(name: 'xenon').store
      Vedeu::Geometry.new(name: 'xenon', x: 1, y: 1, xn: 3, yn: 3).store
      Vedeu::Configuration.stubs(:drb?).returns(drb)
      Vedeu.renderers.stubs(:render)
    end

    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
        context 'when DRb is enabled' do
          let(:drb) { true }
        end

        context 'when DRb is not enabled' do
        end
      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) }

      context 'when the interface is visible' do
      end

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

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

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

  end # Clear

end # Vedeu

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vedeu-0.4.17 test/lib/vedeu/output/clear_test.rb
vedeu-0.4.16 test/lib/vedeu/output/clear_test.rb