Sha256: 5e148563b668ef22b54a3461a24f51d4a98094c7be715bd87433b750edbda296

Contents?: true

Size: 1.14 KB

Versions: 5

Compression:

Stored size: 1.14 KB

Contents

require_relative '../../test_helper'
require_relative '../../../lib/vedeu/configuration'

module Vedeu
  describe Configuration do
    let(:described_class)    { Configuration }
    let(:described_instance) { described_class.new(args) }
    let(:args)               { [] }
    let(:subject)            { described_instance }

    describe '#initialize' do
      let(:subject) { described_instance }

      it 'returns a Configuration instance' do
        subject.must_be_instance_of(Configuration)
      end

      it 'sets an instance variable' do
        subject.instance_variable_get('@args').must_equal([])
      end

      it 'sets an instance variable' do
        subject.instance_variable_get('@options').must_equal({})
      end
    end

    describe '#configure' do
      let(:subject) { described_class.configure(args) }

      it 'returns a Hash' do
        subject.must_be_instance_of(Hash)
      end

      context 'when the option is --run-once' do
        let(:args) { ['--run-once'] }

        it 'returns the options which instructs Vedeu to run once' do
          subject.must_equal({ interactive: false })
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
vedeu-0.0.30 test/lib/vedeu/configuration_test.rb
vedeu-0.0.29 test/lib/vedeu/configuration_test.rb
vedeu-0.0.28 test/lib/vedeu/configuration_test.rb
vedeu-0.0.27 test/lib/vedeu/configuration_test.rb
vedeu-0.0.26 test/lib/vedeu/configuration_test.rb