Sha256: 9dc65662191982256de1bb327fd3aa20e533494f5fff945a143f0b62b125245f

Contents?: true

Size: 1.62 KB

Versions: 3

Compression:

Stored size: 1.62 KB

Contents

require 'test_helper'

module Vedeu
  describe Configuration do
    before { Configuration.reset }
    after  { Configuration.reset }

    describe '#colour_mode' do
      it 'returns the value of the colour_mode option' do
        ENV['VEDEU_TERM'] = 'xterm-truecolor'
        Configuration.colour_mode.must_equal(16777216)
      end
    end

    describe '#debug?' do
      it 'returns the value of the debug option' do
        Configuration.debug?.must_equal(false)
      end
    end

    describe '#interactive?' do
      it 'returns the value of the interactive option' do
        Configuration.interactive?.must_equal(true)
      end
    end

    describe '#once?' do
      it 'returns the value of the once option' do
        Configuration.once?.must_equal(false)
      end
    end

    describe '#terminal_mode' do
      it 'returns the value of the mode option' do
        Configuration.terminal_mode.must_equal(:raw)
      end
    end

    describe '#trace?' do
      it 'returns the value of the trace option' do
        Configuration.trace?.must_equal(false)
      end
    end

    describe '.configure' do
      it 'returns the options configured' do
        Configuration.configure.must_equal(
          {
            colour_mode:   16777216,
            debug:         false,
            interactive:   true,
            once:          false,
            system_keys:   {
              exit:        "q",
              focus_next:  :tab,
              focus_prev:  :shift_tab,
              mode_switch: :escape
            },
            terminal_mode: :raw,
            trace:         false
          }
        )
      end
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
vedeu-0.2.4 test/lib/vedeu/configuration/configuration_test.rb
vedeu-0.2.3 test/lib/vedeu/configuration/configuration_test.rb
vedeu-0.2.2 test/lib/vedeu/configuration/configuration_test.rb