spec/beaker/options/options_hash_spec.rb in beaker-2.1.0 vs spec/beaker/options/options_hash_spec.rb in beaker-2.2.0
- old
+ new
@@ -43,9 +43,33 @@
it "does not alter the original hash when doing a merge" do
options.merge({'key' => {'subkey' => 'subvalue'}})
expect(options[:key]).to be === nil
end
+ describe '#get_type' do
+ let(:options) { Beaker::Options::OptionsHash.new }
+
+ it 'returns pe as expected in the normal case' do
+ newhash = options.merge({:type => 'pe'})
+ expect(newhash.get_type).to be === :pe
+ end
+
+ it 'returns foss as expected in the normal case' do
+ newhash = options.merge({:type => 'foss'})
+ expect(newhash.get_type).to be === :foss
+ end
+
+ it 'returns aio as expected in the normal case' do
+ newhash = options.merge({:type => 'aio'})
+ expect(newhash.get_type).to be === :aio
+ end
+
+ it 'returns foss as the default' do
+ newhash = options.merge({:type => 'git'})
+ expect(newhash.get_type).to be === :foss
+ end
+ end
+
context 'pretty prints itself' do
it 'in valid JSON' do
require 'json'