Решение на Трета задача - Четене на командни аргументи от Натали Арабаджийска
Обратно към всички решения
Към профила на Натали Арабаджийска
Резултати
- 2 точки от тестове
- 0 бонус точки
- 2 точки общо
- 6 успешни тест(а)
- 9 неуспешни тест(а)
Код
Лог от изпълнението
.....F.FFFFFFFF
Failures:
1) CommandParser#option_with_parameter parses a option with parameter in short format
Failure/Error: parser.parse(command_runner, %w(-stime))
NoMethodError:
undefined method `call' for nil:NilClass
# /tmp/d20161113-27983-6wupv8/solution.rb:32:in `block in option_help'
# /tmp/d20161113-27983-6wupv8/solution.rb:31:in `each'
# /tmp/d20161113-27983-6wupv8/solution.rb:31:in `option_help'
# /tmp/d20161113-27983-6wupv8/solution.rb:59:in `parse'
# /tmp/d20161113-27983-6wupv8/spec.rb:87:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
2) CommandParser#help shows basic usage message
Failure/Error: expect(parser.help).to eq 'Usage: ls'
NoMethodError:
undefined method `attr_reader' for #<CommandParser:0x007f5a9ec8d390>
# /tmp/d20161113-27983-6wupv8/solution.rb:50:in `help'
# /tmp/d20161113-27983-6wupv8/spec.rb:104:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
3) CommandParser#help shows single argument
Failure/Error: expect(parser.help).to eq 'Usage: ls [FILE]'
NoMethodError:
undefined method `attr_reader' for #<CommandParser:0x007f5a9ec7c400>
# /tmp/d20161113-27983-6wupv8/solution.rb:50:in `help'
# /tmp/d20161113-27983-6wupv8/spec.rb:110:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
4) CommandParser#help shows multiple arguments
Failure/Error: expect(parser.help).to eq 'Usage: ls [FIRST FILE] [SECOND FILE] [THIRD FILE]'
NoMethodError:
undefined method `attr_reader' for #<CommandParser:0x007f5a9ec78c88>
# /tmp/d20161113-27983-6wupv8/solution.rb:50:in `help'
# /tmp/d20161113-27983-6wupv8/spec.rb:118:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
5) CommandParser#help shows single option help
Failure/Error: parser.help.lines.map(&:chomp).drop(1)
NoMethodError:
undefined method `attr_reader' for #<CommandParser:0x007f5a9ec5a940>
# /tmp/d20161113-27983-6wupv8/solution.rb:50:in `help'
# /tmp/d20161113-27983-6wupv8/spec.rb:19:in `options_help_messages'
# /tmp/d20161113-27983-6wupv8/spec.rb:125:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
6) CommandParser#help shows multiple options help
Failure/Error: parser.help.lines.map(&:chomp).drop(1)
NoMethodError:
undefined method `attr_reader' for #<CommandParser:0x007f5a9ec40fb8>
# /tmp/d20161113-27983-6wupv8/solution.rb:50:in `help'
# /tmp/d20161113-27983-6wupv8/spec.rb:19:in `options_help_messages'
# /tmp/d20161113-27983-6wupv8/spec.rb:137:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
7) CommandParser#help shows options with parameter
Failure/Error: parser.help.lines.map(&:chomp).drop(1)
NoMethodError:
undefined method `attr_reader' for #<CommandParser:0x007f5a9ec297f0>
# /tmp/d20161113-27983-6wupv8/solution.rb:50:in `help'
# /tmp/d20161113-27983-6wupv8/spec.rb:19:in `options_help_messages'
# /tmp/d20161113-27983-6wupv8/spec.rb:148:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
8) CommandParser when having options with and without values and parameters parses all the options and arguments correctly
Failure/Error: parser.parse(command_runner, %w(--all -d -ssize first.rb second.rb))
NoMethodError:
undefined method `call' for nil:NilClass
# /tmp/d20161113-27983-6wupv8/solution.rb:32:in `block in option_help'
# /tmp/d20161113-27983-6wupv8/solution.rb:31:in `each'
# /tmp/d20161113-27983-6wupv8/solution.rb:31:in `option_help'
# /tmp/d20161113-27983-6wupv8/solution.rb:59:in `parse'
# /tmp/d20161113-27983-6wupv8/spec.rb:169:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
9) CommandParser when having options with and without values and parameters generates a correct help usage
Failure/Error: header = parser.help.lines.first.chomp
NoMethodError:
undefined method `attr_reader' for #<CommandParser:0x007f5a9ebf0e28>
# /tmp/d20161113-27983-6wupv8/solution.rb:50:in `help'
# /tmp/d20161113-27983-6wupv8/spec.rb:181:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:7:in `block (2 levels) in <top (required)>'
Finished in 0.00838 seconds
15 examples, 9 failures
Failed examples:
rspec /tmp/d20161113-27983-6wupv8/spec.rb:83 # CommandParser#option_with_parameter parses a option with parameter in short format
rspec /tmp/d20161113-27983-6wupv8/spec.rb:103 # CommandParser#help shows basic usage message
rspec /tmp/d20161113-27983-6wupv8/spec.rb:107 # CommandParser#help shows single argument
rspec /tmp/d20161113-27983-6wupv8/spec.rb:113 # CommandParser#help shows multiple arguments
rspec /tmp/d20161113-27983-6wupv8/spec.rb:121 # CommandParser#help shows single option help
rspec /tmp/d20161113-27983-6wupv8/spec.rb:130 # CommandParser#help shows multiple options help
rspec /tmp/d20161113-27983-6wupv8/spec.rb:143 # CommandParser#help shows options with parameter
rspec /tmp/d20161113-27983-6wupv8/spec.rb:168 # CommandParser when having options with and without values and parameters parses all the options and arguments correctly
rspec /tmp/d20161113-27983-6wupv8/spec.rb:180 # CommandParser when having options with and without values and parameters generates a correct help usage
История (1 версия и 0 коментара)
Натали обнови решението на 09.11.2016 08:59 (преди около 8 години)