Решение на Трета задача от Георги Буюклиев
Обратно към всички решения
Към профила на Георги Буюклиев
Резултати
- 2 точки от тестове
- 0 бонус точки
- 2 точки общо
- 14 успешни тест(а)
- 30 неуспешни тест(а)
Код
Лог от изпълнението
FFFFFFFFFFFFFFFFFF......F..FF..F..FFFF..FFFF
Failures:
1) RBFS Directory can add a file
Failure/Error: expect(directory.files).to eq({'README' => file})
expected: {"README"=>#<RBFS::File:0xb8d63040 @object="Hey there!">}
got: nil
(compared using ==)
# /tmp/d20141111-26053-f19izl/spec.rb:146: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)>'
2) RBFS Directory can create empty directory
Failure/Error: expect(directory.directories.keys ).to eq ['home']
NoMethodError:
undefined method `directories' for #<RBFS::Directory:0xb8d60bd8>
# /tmp/d20141111-26053-f19izl/spec.rb:152: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)>'
3) RBFS Directory can add a directory
Failure/Error: expect(directory.directories).to eq({'home' => subdirectory})
NoMethodError:
undefined method `directories' for #<RBFS::Directory:0xb8d600fc>
# /tmp/d20141111-26053-f19izl/spec.rb:161: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 Directory without files returns empty hash for the files
Failure/Error: expect(directory.files).to eq({})
expected: {}
got: nil
(compared using ==)
# /tmp/d20141111-26053-f19izl/spec.rb:7: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)>'
5) 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-f19izl/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)>'
6) RBFS Directory without directories returns empty hash for the directories
Failure/Error: expect(directory.directories).to eq({})
NoMethodError:
undefined method `directories' for #<RBFS::Directory:0xb8d5d94c>
# /tmp/d20141111-26053-f19izl/spec.rb:17: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)>'
7) RBFS Directory with files and directories returns correct file hash
Failure/Error: expect(directory.files).to eq({'README' => readme, 'spec.rb' => spec})
expected: {"README"=>#<RBFS::File:0xb8d5c3a8 @object="Hello world!">, "spec.rb"=>#<RBFS::File:0xb8d5c2f4 @object="describe RBFS">}
got: nil
(compared using ==)
# /tmp/d20141111-26053-f19izl/spec.rb:34: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)>'
8) RBFS Directory with files and directories returns correct directory hash
Failure/Error: expect(directory.directories).to eq({'rbfs' => rbfs})
NoMethodError:
undefined method `directories' for #<RBFS::Directory:0xb8bff320>
# /tmp/d20141111-26053-f19izl/spec.rb:38: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)>'
9) 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-f19izl/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)>'
10) RBFS Directory serialization #serialize can serialize multiple directories recursively
Failure/Error: directory['rbfs'].add_file 'solution.rb', RBFS::File.new(:hidden)
NoMethodError:
undefined method `add_file' for nil:NilClass
# /tmp/d20141111-26053-f19izl/spec.rb:91: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 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-f19izl/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)>'
12) 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-f19izl/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)>'
13) 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-f19izl/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)>'
14) 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-f19izl/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)>'
15) RBFS Directory #[] can walk a single directory
Failure/Error: expect(directory['home']).to eq home
expected: #<RBFS::Directory:0xb8bf83f4 @directories={"user"=>#<RBFS::Directory:0xb8bf8390 @directories={"ruby"=>#<RBFS::Directory:0xb8bf832c @files={"file"=>#<RBFS::File:0xb8bf82c8 @object="hi">}>}>}>
got: nil
(compared using ==)
# /tmp/d20141111-26053-f19izl/spec.rb:178: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)>'
16) RBFS Directory #[] can walk multiple directories
Failure/Error: expect(directory['home']['user']['ruby']).to eq ruby
NoMethodError:
undefined method `[]' for nil:NilClass
# /tmp/d20141111-26053-f19izl/spec.rb:182: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)>'
17) RBFS Directory #[] can get files
Failure/Error: expect(directory['home']['user']['ruby']['file']).to eq file
NoMethodError:
undefined method `[]' for nil:NilClass
# /tmp/d20141111-26053-f19izl/spec.rb:186: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)>'
18) RBFS Directory #[] returns nil if directory or file doesnt exist
Failure/Error: expect(directory['home']['another_user']).to be_nil
NoMethodError:
undefined method `[]' for nil:NilClass
# /tmp/d20141111-26053-f19izl/spec.rb:190: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)>'
19) RBFS File data type nil can be parsed
Failure/Error: expect(file.data ).to eq nil
NoMethodError:
undefined method `data' for nil:NilClass
# /tmp/d20141111-26053-f19izl/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)>'
20) RBFS File data type string can be parsed
Failure/Error: expect(file.data ).to eq 'Hey there'
NoMethodError:
undefined method `data' for nil:NilClass
# /tmp/d20141111-26053-f19izl/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)>'
21) RBFS File data type string can parse a string with colons
Failure/Error: expect(file.data ).to eq 'Hay :)'
NoMethodError:
undefined method `data' for nil:NilClass
# /tmp/d20141111-26053-f19izl/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)>'
22) RBFS File data type symbol can be parsed
Failure/Error: expect(file.data ).to eq :hello
NoMethodError:
undefined method `data' for nil:NilClass
# /tmp/d20141111-26053-f19izl/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)>'
23) RBFS File data type number can be parsed
Failure/Error: expect(file.data ).to eq 1234
NoMethodError:
undefined method `data' for nil:NilClass
# /tmp/d20141111-26053-f19izl/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)>'
24) RBFS File data type float number can be detected
Failure/Error: expect(file.data_type).to eq :number
expected: :number
got: nil
(compared using ==)
# /tmp/d20141111-26053-f19izl/spec.rb:304: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)>'
25) RBFS File data type float number can be serialized
Failure/Error: expect(file.serialize).to eq 'number:666.6'
expected: "number:666.6"
got: ":666.6"
(compared using ==)
# /tmp/d20141111-26053-f19izl/spec.rb:308: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)>'
26) RBFS File data type float number can be parsed
Failure/Error: expect(file.data ).to eq 3.14
NoMethodError:
undefined method `data' for nil:NilClass
# /tmp/d20141111-26053-f19izl/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)>'
27) RBFS File data type boolean true can be parsed
Failure/Error: expect(file.data ).to eq true
NoMethodError:
undefined method `data' for nil:NilClass
# /tmp/d20141111-26053-f19izl/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)>'
28) RBFS File data type boolean false can be detected
Failure/Error: expect(file.data_type).to eq :boolean
expected: :boolean
got: nil
(compared using ==)
# /tmp/d20141111-26053-f19izl/spec.rb:342: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)>'
29) RBFS File data type boolean false can be serialized
Failure/Error: expect(file.serialize).to eq 'boolean:false'
expected: "boolean:false"
got: ":false"
(compared using ==)
# /tmp/d20141111-26053-f19izl/spec.rb:347: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)>'
30) RBFS File data type boolean false can be parsed
Failure/Error: expect(file.data ).to eq false
NoMethodError:
undefined method `data' for nil:NilClass
# /tmp/d20141111-26053-f19izl/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.04097 seconds
44 examples, 30 failures
Failed examples:
rspec /tmp/d20141111-26053-f19izl/spec.rb:141 # RBFS Directory can add a file
rspec /tmp/d20141111-26053-f19izl/spec.rb:149 # RBFS Directory can create empty directory
rspec /tmp/d20141111-26053-f19izl/spec.rb:156 # RBFS Directory can add a directory
rspec /tmp/d20141111-26053-f19izl/spec.rb:6 # RBFS Directory without files returns empty hash for the files
rspec /tmp/d20141111-26053-f19izl/spec.rb:10 # RBFS Directory without files can be serialized
rspec /tmp/d20141111-26053-f19izl/spec.rb:16 # RBFS Directory without directories returns empty hash for the directories
rspec /tmp/d20141111-26053-f19izl/spec.rb:33 # RBFS Directory with files and directories returns correct file hash
rspec /tmp/d20141111-26053-f19izl/spec.rb:37 # RBFS Directory with files and directories returns correct directory hash
rspec /tmp/d20141111-26053-f19izl/spec.rb:76 # RBFS Directory serialization #serialize can serialize
rspec /tmp/d20141111-26053-f19izl/spec.rb:84 # RBFS Directory serialization #serialize can serialize multiple directories recursively
rspec /tmp/d20141111-26053-f19izl/spec.rb:100 # RBFS Directory serialization ::parse can parse empty directories
rspec /tmp/d20141111-26053-f19izl/spec.rb:107 # RBFS Directory serialization ::parse can parse directories with files
rspec /tmp/d20141111-26053-f19izl/spec.rb:116 # RBFS Directory serialization ::parse can parse directory trees without files
rspec /tmp/d20141111-26053-f19izl/spec.rb:124 # RBFS Directory serialization ::parse can parse directories recursively
rspec /tmp/d20141111-26053-f19izl/spec.rb:177 # RBFS Directory #[] can walk a single directory
rspec /tmp/d20141111-26053-f19izl/spec.rb:181 # RBFS Directory #[] can walk multiple directories
rspec /tmp/d20141111-26053-f19izl/spec.rb:185 # RBFS Directory #[] can get files
rspec /tmp/d20141111-26053-f19izl/spec.rb:189 # RBFS Directory #[] returns nil if directory or file doesnt exist
rspec /tmp/d20141111-26053-f19izl/spec.rb:229 # RBFS File data type nil can be parsed
rspec /tmp/d20141111-26053-f19izl/spec.rb:247 # RBFS File data type string can be parsed
rspec /tmp/d20141111-26053-f19izl/spec.rb:254 # RBFS File data type string can parse a string with colons
rspec /tmp/d20141111-26053-f19izl/spec.rb:273 # RBFS File data type symbol can be parsed
rspec /tmp/d20141111-26053-f19izl/spec.rb:292 # RBFS File data type number can be parsed
rspec /tmp/d20141111-26053-f19izl/spec.rb:303 # RBFS File data type float number can be detected
rspec /tmp/d20141111-26053-f19izl/spec.rb:307 # RBFS File data type float number can be serialized
rspec /tmp/d20141111-26053-f19izl/spec.rb:311 # RBFS File data type float number can be parsed
rspec /tmp/d20141111-26053-f19izl/spec.rb:331 # RBFS File data type boolean true can be parsed
rspec /tmp/d20141111-26053-f19izl/spec.rb:340 # RBFS File data type boolean false can be detected
rspec /tmp/d20141111-26053-f19izl/spec.rb:345 # RBFS File data type boolean false can be serialized
rspec /tmp/d20141111-26053-f19izl/spec.rb:350 # RBFS File data type boolean false can be parsed
История (6 версии и 0 коментара)
Георги обнови решението на 10.11.2014 03:10 (преди около 10 години)
Георги обнови решението на 10.11.2014 16:42 (преди около 10 години)
Георги обнови решението на 10.11.2014 16:42 (преди около 10 години)
Георги обнови решението на 10.11.2014 16:43 (преди около 10 години)
Георги обнови решението на 10.11.2014 16:54 (преди около 10 години)
Георги обнови решението на 10.11.2014 16:56 (преди около 10 години)