Sha256: 04d5939812e033f5a653fa7db5fbb0b84d17850b213cf40557aefa45c058b114

Contents?: true

Size: 391 Bytes

Versions: 1

Compression:

Stored size: 391 Bytes

Contents

require 'samovar'
require 'stringio'

module Command
	class Coerce < Samovar::Command
		options do
			option '--things <array>', "A list of things" do |input|
				input.split(/\s*,\s*/)
			end
		end
	end
end

describe Samovar::Command do
	it "should use default value" do
		top = Command::Coerce.parse(['--things', 'a,b,c'])
		expect(top.options[:things]).to be == ['a', 'b', 'c']
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
samovar-1.2.0 spec/samovar/type_spec.rb