Sha256: 65083c0449bfc567d1442e1d8ebfdd70c398e316bd89670b27e2e79831bee8c3

Contents?: true

Size: 543 Bytes

Versions: 1

Compression:

Stored size: 543 Bytes

Contents

require 'test_helper'

require 'vedeu/api/grid'

module Vedeu
  module API
    describe Grid do
      it 'raises an exception if the value is less than 1' do
        proc { Grid.columns(0) }.must_raise(OutOfRange)
      end

      it 'raises an exception if the value is greater than 12' do
        proc { Grid.columns(13) }.must_raise(OutOfRange)
      end

      it 'returns the width if the value is in range' do
        IO.console.stub :winsize, [25, 80] do
          Grid.columns(7).must_equal(42)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vedeu-0.1.6 test/lib/vedeu/api/grid_test.rb