Решение на Трета задача от Мая Терзиева
Обратно към всички решения
Към профила на Мая Терзиева
Резултати
- 4 точки от тестове
- 0 бонус точки
- 4 точки общо
- 29 успешни тест(а)
- 15 неуспешни тест(а)
Код
Лог от изпълнението
....F...FFFFFF..........F..FF..F..F..F..F..F
Failures:
1) RBFS Directory without files can be serialized
Failure/Error: expect(directory.serialize).to eq '0:0:'
expected: "0:0:"
got: nil
(compared using ==)
# /tmp/d20141111-26053-1ja8tqq/spec.rb:11:in `block (4 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
2) RBFS Directory serialization #serialize can serialize
Failure/Error: expect(directory.serialize).to eq simple_serialized_string
expected: "2:README:19:string:Hello world!spec.rb:20:string:describe RBFS1:rbfs:4:0:0:"
got: nil
(compared using ==)
# /tmp/d20141111-26053-1ja8tqq/spec.rb:81:in `block (5 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
3) RBFS Directory serialization #serialize can serialize multiple directories recursively
Failure/Error: expect(directory.serialize).to eq recursive_serialized_string
expected: "2:README:19:string:Hello world!spec.rb:20:string:describe RBFS2:rbfs:64:1:solution.rb:13:symbol:hidden1:spec:24:1:test:12:boolean:true0:sample:4:0:0:"
got: nil
(compared using ==)
# /tmp/d20141111-26053-1ja8tqq/spec.rb:95:in `block (5 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
4) RBFS Directory serialization ::parse can parse empty directories
Failure/Error: expect(parsed_directory.files ).to eq({})
NoMethodError:
undefined method `files' for nil:NilClass
# /tmp/d20141111-26053-1ja8tqq/spec.rb:103:in `block (5 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
5) RBFS Directory serialization ::parse can parse directories with files
Failure/Error: expect(parsed_directory.files.size ).to eq 2
NoMethodError:
undefined method `files' for nil:NilClass
# /tmp/d20141111-26053-1ja8tqq/spec.rb:110:in `block (5 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
6) RBFS Directory serialization ::parse can parse directory trees without files
Failure/Error: expect(parsed_directory['dir1'] ).to be_an RBFS::Directory
NoMethodError:
undefined method `[]' for nil:NilClass
# /tmp/d20141111-26053-1ja8tqq/spec.rb:119:in `block (5 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
7) RBFS Directory serialization ::parse can parse directories recursively
Failure/Error: expect(parsed_directory.files.size ).to eq 2
NoMethodError:
undefined method `files' for nil:NilClass
# /tmp/d20141111-26053-1ja8tqq/spec.rb:127:in `block (5 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
8) RBFS File data type nil can be parsed
Failure/Error: file = RBFS::File.parse('nil:')
SyntaxError:
(eval):1: syntax error, unexpected ':', expecting end-of-input
# /tmp/d20141111-26053-1ja8tqq/solution.rb:18:in `eval'
# /tmp/d20141111-26053-1ja8tqq/solution.rb:18:in `parse'
# /tmp/d20141111-26053-1ja8tqq/spec.rb:230:in `block (5 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
9) RBFS File data type string can be parsed
Failure/Error: file = RBFS::File.parse('string:Hey there')
SyntaxError:
(eval):1: syntax error, unexpected tIDENTIFIER, expecting end-of-input
string:Hey there
^
# /tmp/d20141111-26053-1ja8tqq/solution.rb:18:in `eval'
# /tmp/d20141111-26053-1ja8tqq/solution.rb:18:in `parse'
# /tmp/d20141111-26053-1ja8tqq/spec.rb:248:in `block (5 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
10) RBFS File data type string can parse a string with colons
Failure/Error: file = RBFS::File.parse('string:Hay :)')
SyntaxError:
(eval):1: syntax error, unexpected ':', expecting end-of-input
string:Hay :)
^
# /tmp/d20141111-26053-1ja8tqq/solution.rb:18:in `eval'
# /tmp/d20141111-26053-1ja8tqq/solution.rb:18:in `parse'
# /tmp/d20141111-26053-1ja8tqq/spec.rb:255:in `block (5 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
11) RBFS File data type symbol can be parsed
Failure/Error: file = RBFS::File.parse('symbol:hello')
NoMethodError:
undefined method `symbol' for RBFS::File:Class
# /tmp/d20141111-26053-1ja8tqq/solution.rb:18:in `eval'
# /tmp/d20141111-26053-1ja8tqq/solution.rb:18:in `eval'
# /tmp/d20141111-26053-1ja8tqq/solution.rb:18:in `parse'
# /tmp/d20141111-26053-1ja8tqq/spec.rb:274:in `block (5 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
12) RBFS File data type number can be parsed
Failure/Error: file = RBFS::File.parse('number:1234')
SyntaxError:
(eval):1: syntax error, unexpected tINTEGER, expecting tSTRING_CONTENT or tSTRING_DBEG or tSTRING_DVAR or tSTRING_END
number:1234
^
# /tmp/d20141111-26053-1ja8tqq/solution.rb:18:in `eval'
# /tmp/d20141111-26053-1ja8tqq/solution.rb:18:in `parse'
# /tmp/d20141111-26053-1ja8tqq/spec.rb:293:in `block (5 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
13) RBFS File data type float number can be parsed
Failure/Error: file = RBFS::File.parse('number:3.14')
SyntaxError:
(eval):1: syntax error, unexpected tFLOAT, expecting tSTRING_CONTENT or tSTRING_DBEG or tSTRING_DVAR or tSTRING_END
number:3.14
^
# /tmp/d20141111-26053-1ja8tqq/solution.rb:18:in `eval'
# /tmp/d20141111-26053-1ja8tqq/solution.rb:18:in `parse'
# /tmp/d20141111-26053-1ja8tqq/spec.rb:312:in `block (5 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
14) RBFS File data type boolean true can be parsed
Failure/Error: file = RBFS::File.parse('boolean:true')
NoMethodError:
undefined method `boolean' for RBFS::File:Class
# /tmp/d20141111-26053-1ja8tqq/solution.rb:18:in `eval'
# /tmp/d20141111-26053-1ja8tqq/solution.rb:18:in `eval'
# /tmp/d20141111-26053-1ja8tqq/solution.rb:18:in `parse'
# /tmp/d20141111-26053-1ja8tqq/spec.rb:332:in `block (6 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
15) RBFS File data type boolean false can be parsed
Failure/Error: file = RBFS::File.parse('boolean:false')
NoMethodError:
undefined method `boolean' for RBFS::File:Class
# /tmp/d20141111-26053-1ja8tqq/solution.rb:18:in `eval'
# /tmp/d20141111-26053-1ja8tqq/solution.rb:18:in `eval'
# /tmp/d20141111-26053-1ja8tqq/solution.rb:18:in `parse'
# /tmp/d20141111-26053-1ja8tqq/spec.rb:351:in `block (6 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 0.0533 seconds
44 examples, 15 failures
Failed examples:
rspec /tmp/d20141111-26053-1ja8tqq/spec.rb:10 # RBFS Directory without files can be serialized
rspec /tmp/d20141111-26053-1ja8tqq/spec.rb:76 # RBFS Directory serialization #serialize can serialize
rspec /tmp/d20141111-26053-1ja8tqq/spec.rb:84 # RBFS Directory serialization #serialize can serialize multiple directories recursively
rspec /tmp/d20141111-26053-1ja8tqq/spec.rb:100 # RBFS Directory serialization ::parse can parse empty directories
rspec /tmp/d20141111-26053-1ja8tqq/spec.rb:107 # RBFS Directory serialization ::parse can parse directories with files
rspec /tmp/d20141111-26053-1ja8tqq/spec.rb:116 # RBFS Directory serialization ::parse can parse directory trees without files
rspec /tmp/d20141111-26053-1ja8tqq/spec.rb:124 # RBFS Directory serialization ::parse can parse directories recursively
rspec /tmp/d20141111-26053-1ja8tqq/spec.rb:229 # RBFS File data type nil can be parsed
rspec /tmp/d20141111-26053-1ja8tqq/spec.rb:247 # RBFS File data type string can be parsed
rspec /tmp/d20141111-26053-1ja8tqq/spec.rb:254 # RBFS File data type string can parse a string with colons
rspec /tmp/d20141111-26053-1ja8tqq/spec.rb:273 # RBFS File data type symbol can be parsed
rspec /tmp/d20141111-26053-1ja8tqq/spec.rb:292 # RBFS File data type number can be parsed
rspec /tmp/d20141111-26053-1ja8tqq/spec.rb:311 # RBFS File data type float number can be parsed
rspec /tmp/d20141111-26053-1ja8tqq/spec.rb:331 # RBFS File data type boolean true can be parsed
rspec /tmp/d20141111-26053-1ja8tqq/spec.rb:350 # RBFS File data type boolean false can be parsed
История (1 версия и 4 коментара)
Мая обнови решението на 05.11.2014 12:52 (преди около 10 години)