test/lib/vedeu/configuration_test.rb in vedeu-0.0.30 vs test/lib/vedeu/configuration_test.rb in vedeu-0.0.31
- old
+ new
@@ -1,43 +1,17 @@
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)
+ it 'returns an empty collection when no options are set' do
+ Configuration.configure([]).must_equal({})
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
+ it 'returns the options which instructs Vedeu to run once' do
+ Configuration.configure(['--run-once'])
+ .must_equal({ interactive: false })
end
end
end
end