Skip to content

Commit

Permalink
modify spec args
Browse files Browse the repository at this point in the history
  • Loading branch information
naoto committed Dec 2, 2014
1 parent f06d281 commit 266f07f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/ltsview/parse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def option_parse(options)
option.on('-i', '--ignore-key VAL'){ |v| @options[:ignore_key] = v.split(',') }
option.on('-r', '--regexp VAL', /\A([^:]+):(.*)/){ |k,x,y|
@options[:regex] = k.split(":", 2)
#@options[:regex] = {:key => key.to_sym, :value => val}
}
option.on('-j', '--json') { |v| @options[:mode] = :json }
option.on('-l', '--ltsv') { |v| @options[:mode] = :ltsv }
Expand All @@ -42,6 +41,7 @@ def option_parse(options)
puts "LTSView version: #{Ltsview::VERSION}"
exit
}

option.permute!(options)

@options[:color] = false if @options[:mode] == :ltsv
Expand Down
4 changes: 2 additions & 2 deletions spec/ltsview/parse_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

describe 'when encode stdin text line' do
it 'should get yaml' do
parse = Ltsview::Parse.new(ARGV)
parse = Ltsview::Parse.new([])
capture(:stdout) {
$stdin = StringIO.new
$stdin << "hoge:fuga hago\tfoo:barbaz\n"
Expand Down Expand Up @@ -96,7 +96,7 @@

describe 'when color mode' do
it 'should by default color mode on' do
parse = Ltsview::Parse.new(ARGV)
parse = Ltsview::Parse.new([])
capture(:stdout){
$stdin = StringIO.new
$stdin << "hoge:fuga hago\tfoo:barbaz\n"
Expand Down

0 comments on commit 266f07f

Please sign in to comment.