Решение на Трета задача от Светослав Кръстев
Обратно към всички решения
Към профила на Светослав Кръстев
Резултати
- 4 точки от тестове
- 0 бонус точки
- 4 точки общо
- 31 успешни тест(а)
- 13 неуспешни тест(а)
Код
Лог от изпълнението
...........F.F.....FFF..F..FF..F..F..F..F..F
Failures:
1) RBFS Directory serialization ::parse can parse directories with files
Failure/Error: expect(parsed_directory['README'].data ).to eq 'Hello world!'
NoMethodError:
undefined method `data' for #<RBFS::File:0xb8c7e97c @content="Hello world!", @type=:string>
# /tmp/d20141111-26053-5clle0/spec.rb:111: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)>'
2) RBFS Directory serialization ::parse can parse directories recursively
Failure/Error: expect(parsed_directory['README'].data ).to eq 'Hello world!'
NoMethodError:
undefined method `data' for #<RBFS::File:0xb8c73af4 @content="Hello world!", @type=:string>
# /tmp/d20141111-26053-5clle0/spec.rb:128: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 File has nil as initial data
Failure/Error: expect(file.data).to eq nil
NoMethodError:
undefined method `data' for #<RBFS::File:0xb8c650bc @content=nil, @type=:nil>
# /tmp/d20141111-26053-5clle0/spec.rb:203:in `block (3 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 File can store data
Failure/Error: expect(file.data).to eq 'hello world'
NoMethodError:
undefined method `data' for #<RBFS::File:0xb8c64360 @content="hello world", @type=:string>
# /tmp/d20141111-26053-5clle0/spec.rb:208:in `block (3 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 File can accept data in the initializer
Failure/Error: expect(file.data).to eq 'Hay :)'
NoMethodError:
undefined method `data' for #<RBFS::File:0xb8c63708 @content="Hay :)", @type=:string>
# /tmp/d20141111-26053-5clle0/spec.rb:214:in `block (3 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 File data type nil can be parsed
Failure/Error: expect(file.data ).to eq nil
NoMethodError:
undefined method `data' for #<RBFS::File:0xb8c60f44 @content=nil, @type=:nil>
# /tmp/d20141111-26053-5clle0/spec.rb:231: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 File data type string can be parsed
Failure/Error: expect(file.data ).to eq 'Hey there'
NoMethodError:
undefined method `data' for #<RBFS::File:0xb8d31a54 @content="Hey there", @type=:string>
# /tmp/d20141111-26053-5clle0/spec.rb:250: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 string can parse a string with colons
Failure/Error: expect(file.data ).to eq 'Hay :)'
NoMethodError:
undefined method `data' for #<RBFS::File:0xb8d30e10 @content="Hay :)", @type=:string>
# /tmp/d20141111-26053-5clle0/spec.rb:257: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 symbol can be parsed
Failure/Error: expect(file.data ).to eq :hello
NoMethodError:
undefined method `data' for #<RBFS::File:0xb8d2e7a0 @content=":hello", @type=:string>
# /tmp/d20141111-26053-5clle0/spec.rb:276: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 number can be parsed
Failure/Error: expect(file.data ).to eq 1234
NoMethodError:
undefined method `data' for #<RBFS::File:0xb8d2ac90 @content=1234, @type=:number>
# /tmp/d20141111-26053-5clle0/spec.rb:295: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 float number can be parsed
Failure/Error: expect(file.data ).to eq 3.14
NoMethodError:
undefined method `data' for #<RBFS::File:0xb8d28314 @content=3.14, @type=:number>
# /tmp/d20141111-26053-5clle0/spec.rb:314: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 boolean true can be parsed
Failure/Error: expect(file.data ).to eq true
NoMethodError:
undefined method `data' for #<RBFS::File:0xb8d256a0 @content=true, @type=:boolean>
# /tmp/d20141111-26053-5clle0/spec.rb:334: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)>'
13) RBFS File data type boolean false can be parsed
Failure/Error: expect(file.data ).to eq false
NoMethodError:
undefined method `data' for #<RBFS::File:0xb8d93010 @content=false, @type=:boolean>
# /tmp/d20141111-26053-5clle0/spec.rb:353: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.05306 seconds
44 examples, 13 failures
Failed examples:
rspec /tmp/d20141111-26053-5clle0/spec.rb:107 # RBFS Directory serialization ::parse can parse directories with files
rspec /tmp/d20141111-26053-5clle0/spec.rb:124 # RBFS Directory serialization ::parse can parse directories recursively
rspec /tmp/d20141111-26053-5clle0/spec.rb:202 # RBFS File has nil as initial data
rspec /tmp/d20141111-26053-5clle0/spec.rb:206 # RBFS File can store data
rspec /tmp/d20141111-26053-5clle0/spec.rb:211 # RBFS File can accept data in the initializer
rspec /tmp/d20141111-26053-5clle0/spec.rb:229 # RBFS File data type nil can be parsed
rspec /tmp/d20141111-26053-5clle0/spec.rb:247 # RBFS File data type string can be parsed
rspec /tmp/d20141111-26053-5clle0/spec.rb:254 # RBFS File data type string can parse a string with colons
rspec /tmp/d20141111-26053-5clle0/spec.rb:273 # RBFS File data type symbol can be parsed
rspec /tmp/d20141111-26053-5clle0/spec.rb:292 # RBFS File data type number can be parsed
rspec /tmp/d20141111-26053-5clle0/spec.rb:311 # RBFS File data type float number can be parsed
rspec /tmp/d20141111-26053-5clle0/spec.rb:331 # RBFS File data type boolean true can be parsed
rspec /tmp/d20141111-26053-5clle0/spec.rb:350 # RBFS File data type boolean false can be parsed
История (1 версия и 0 коментара)
Светослав обнови решението на 06.11.2014 00:14 (преди около 10 години)