Sha256: 12b79252cde2d0d363597df2ee7af988c29ba59957425803c363533b0a40b201

Contents?: true

Size: 1.92 KB

Versions: 10

Compression:

Stored size: 1.92 KB

Contents

require 'test_helper'

module Vedeu

  module Null

    describe Geometry do

      let(:described) { Vedeu::Null::Geometry }
      let(:instance)  { described.new(attributes) }
      let(:attributes){
        {
          name: _name
        }
      }
      let(:_name)     { 'null_geometry' }

      before { Vedeu::Terminal.stubs(:size).returns([25, 40]) }

      describe '#initialize' do
        it { instance.must_be_instance_of(described) }
        it {
          instance.instance_variable_get('@attributes').must_equal(attributes)
        }
        it { instance.instance_variable_get('@name').must_equal(_name) }
      end

      describe 'accessors' do
        it { instance.must_respond_to(:maximised) }
        it { instance.must_respond_to(:maximised=) }
        it { instance.must_respond_to(:name) }
      end

      describe '#null?' do
        subject { instance.null? }

        it { subject.must_be_instance_of(TrueClass) }
      end

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

        it { subject.must_equal(false) }
      end

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

        it { subject.must_equal(false) }
      end

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

        it { subject.must_be_instance_of(described) }
      end

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

        it { subject.must_equal(false) }
      end

      describe '#height' do
        it { instance.height.must_equal(25) }
      end

      describe '#width' do
        it { instance.width.must_equal(40) }
      end

      describe '#x' do
        it { instance.x.must_equal(1) }
      end

      describe '#xn' do
        it { instance.xn.must_equal(40) }
      end

      describe '#y' do
        it { instance.y.must_equal(1) }
      end

      describe '#yn' do
        it { instance.yn.must_equal(25) }
      end

    end # Geometry

  end # Null

end # Vedeu

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
vedeu-0.6.3 test/lib/vedeu/null/geometry_test.rb
vedeu-0.6.2 test/lib/vedeu/null/geometry_test.rb
vedeu-0.6.1 test/lib/vedeu/null/geometry_test.rb
vedeu-0.6.0 test/lib/vedeu/null/geometry_test.rb
vedeu-0.5.13 test/lib/vedeu/null/geometry_test.rb
vedeu-0.5.12 test/lib/vedeu/null/geometry_test.rb
vedeu-0.5.11 test/lib/vedeu/null/geometry_test.rb
vedeu-0.5.10 test/lib/vedeu/null/geometry_test.rb
vedeu-0.5.9 test/lib/vedeu/null/geometry_test.rb
vedeu-0.5.8 test/lib/vedeu/null/geometry_test.rb