Sha256: 80e2ad7ff446f46db6509f4eb91a2dbf397512650b0d5cfbb29f409b4eff6097
Contents?: true
Size: 673 Bytes
Versions: 202
Compression:
Stored size: 673 Bytes
Contents
require 'spec_helper' require 'thor/parser' describe Thor::Options do def create(opts, defaults={}) opts.each do |key, value| opts[key] = Thor::Option.parse(key, value) unless value.is_a?(Thor::Option) end @opt = Thor::Options.new(opts, defaults) end def parse(*args) @opt.parse(args.flatten) end describe "#parse" do describe "with :array type" do it "accepts a switch=<value> assignment, where value is a set of paramters split by comma or spaces" do create "--attributes" => :array parse("--attributes=a,b", "c, d", "e , f")["attributes"].should == ["a", "b", "c", "d", "e", "f"] end end end end
Version data entries
202 entries across 202 versions & 1 rubygems