Решение на Трета задача от Ралица Великова

Обратно към всички решения

Към профила на Ралица Великова

Резултати

  • 0 точки от тестове
  • 0 бонус точки
  • 0 точки общо
  • 0 успешни тест(а)
  • 44 неуспешни тест(а)

Код

module RBFS
end
class RBFS::File
def initialize(object)
@content = object.serialize
end
def data_type
@hash = {String: :string, Float: :number,
Integer: :number, Symbol: :symbol, Boolean: :boolean}
@hash[@data_type] || :nil
end
end

Лог от изпълнението

FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

Failures:

  1) RBFS Directory can add a file
     Failure/Error: file = RBFS::File.new('Hey there!')
     NoMethodError:
       undefined method `serialize' for "Hey there!":String
     # /tmp/d20141111-26053-10a436n/solution.rb:6:in `initialize'
     # /tmp/d20141111-26053-10a436n/spec.rb:142:in `new'
     # /tmp/d20141111-26053-10a436n/spec.rb:142: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: subject(:directory) { RBFS::Directory.new }
     NameError:
       uninitialized constant RBFS::Directory
     # /tmp/d20141111-26053-10a436n/spec.rb:3:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:150: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: subdirectory = RBFS::Directory.new
     NameError:
       uninitialized constant RBFS::Directory
     # /tmp/d20141111-26053-10a436n/spec.rb:157: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: subject(:directory) { RBFS::Directory.new }
     NameError:
       uninitialized constant RBFS::Directory
     # /tmp/d20141111-26053-10a436n/spec.rb:3:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/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: subject(:directory) { RBFS::Directory.new }
     NameError:
       uninitialized constant RBFS::Directory
     # /tmp/d20141111-26053-10a436n/spec.rb:3:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/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: subject(:directory) { RBFS::Directory.new }
     NameError:
       uninitialized constant RBFS::Directory
     # /tmp/d20141111-26053-10a436n/spec.rb:3:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/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: subject(:directory) { RBFS::Directory.new }
     NameError:
       uninitialized constant RBFS::Directory
     # /tmp/d20141111-26053-10a436n/spec.rb:3:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:27: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: subject(:directory) { RBFS::Directory.new }
     NameError:
       uninitialized constant RBFS::Directory
     # /tmp/d20141111-26053-10a436n/spec.rb:3:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:27: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: subject(:directory) { RBFS::Directory.new }
     NameError:
       uninitialized constant RBFS::Directory
     # /tmp/d20141111-26053-10a436n/spec.rb:3:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:77: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: subject(:directory) { RBFS::Directory.new }
     NameError:
       uninitialized constant RBFS::Directory
     # /tmp/d20141111-26053-10a436n/spec.rb:3:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:85: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: parsed_directory = RBFS::Directory.parse('0:0:')
     NameError:
       uninitialized constant RBFS::Directory
     # /tmp/d20141111-26053-10a436n/spec.rb:101: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: parsed_directory = RBFS::Directory.parse(simple_serialized_string)
     NameError:
       uninitialized constant RBFS::Directory
     # /tmp/d20141111-26053-10a436n/spec.rb:108: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: parsed_directory = RBFS::Directory.parse('0:2:dir1:15:0:1:dir2:4:0:0:dir3:4:0:0:')
     NameError:
       uninitialized constant RBFS::Directory
     # /tmp/d20141111-26053-10a436n/spec.rb:117: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: parsed_directory = RBFS::Directory.parse(recursive_serialized_string)
     NameError:
       uninitialized constant RBFS::Directory
     # /tmp/d20141111-26053-10a436n/spec.rb:125: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: subject(:directory) { RBFS::Directory.new }
     NameError:
       uninitialized constant RBFS::Directory
     # /tmp/d20141111-26053-10a436n/spec.rb:3:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:171: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: subject(:directory) { RBFS::Directory.new }
     NameError:
       uninitialized constant RBFS::Directory
     # /tmp/d20141111-26053-10a436n/spec.rb:3:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:171: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: subject(:directory) { RBFS::Directory.new }
     NameError:
       uninitialized constant RBFS::Directory
     # /tmp/d20141111-26053-10a436n/spec.rb:3:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:171: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: subject(:directory) { RBFS::Directory.new }
     NameError:
       uninitialized constant RBFS::Directory
     # /tmp/d20141111-26053-10a436n/spec.rb:3:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:171: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 Directory #[] is case-sensitive
     Failure/Error: subject(:directory) { RBFS::Directory.new }
     NameError:
       uninitialized constant RBFS::Directory
     # /tmp/d20141111-26053-10a436n/spec.rb:3:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:171: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)>'

  20) RBFS File has nil as initial data
     Failure/Error: subject(:file) { RBFS::File.new }
     ArgumentError:
       wrong number of arguments (0 for 1)
     # /tmp/d20141111-26053-10a436n/solution.rb:5:in `initialize'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `new'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/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)>'

  21) RBFS File can store data
     Failure/Error: subject(:file) { RBFS::File.new }
     ArgumentError:
       wrong number of arguments (0 for 1)
     # /tmp/d20141111-26053-10a436n/solution.rb:5:in `initialize'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `new'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:207: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)>'

  22) RBFS File can accept data in the initializer
     Failure/Error: file = RBFS::File.new('Hay :)')
     NoMethodError:
       undefined method `serialize' for "Hay :)":String
     # /tmp/d20141111-26053-10a436n/solution.rb:6:in `initialize'
     # /tmp/d20141111-26053-10a436n/spec.rb:212:in `new'
     # /tmp/d20141111-26053-10a436n/spec.rb:212: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)>'

  23) RBFS File data type nil can be detected
     Failure/Error: subject(:file) { RBFS::File.new }
     ArgumentError:
       wrong number of arguments (0 for 1)
     # /tmp/d20141111-26053-10a436n/solution.rb:5:in `initialize'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `new'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:219: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 nil can be serialized
     Failure/Error: subject(:file) { RBFS::File.new }
     ArgumentError:
       wrong number of arguments (0 for 1)
     # /tmp/d20141111-26053-10a436n/solution.rb:5:in `initialize'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `new'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:219: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 nil can be parsed
     Failure/Error: subject(:file) { RBFS::File.new }
     ArgumentError:
       wrong number of arguments (0 for 1)
     # /tmp/d20141111-26053-10a436n/solution.rb:5:in `initialize'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `new'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:219: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 string can be detected
     Failure/Error: subject(:file) { RBFS::File.new }
     ArgumentError:
       wrong number of arguments (0 for 1)
     # /tmp/d20141111-26053-10a436n/solution.rb:5:in `initialize'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `new'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:237: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 string can be serialized
     Failure/Error: subject(:file) { RBFS::File.new }
     ArgumentError:
       wrong number of arguments (0 for 1)
     # /tmp/d20141111-26053-10a436n/solution.rb:5:in `initialize'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `new'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:237: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)>'

  28) RBFS File data type string can be parsed
     Failure/Error: subject(:file) { RBFS::File.new }
     ArgumentError:
       wrong number of arguments (0 for 1)
     # /tmp/d20141111-26053-10a436n/solution.rb:5:in `initialize'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `new'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:237: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)>'

  29) RBFS File data type string can parse a string with colons
     Failure/Error: subject(:file) { RBFS::File.new }
     ArgumentError:
       wrong number of arguments (0 for 1)
     # /tmp/d20141111-26053-10a436n/solution.rb:5:in `initialize'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `new'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:237: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)>'

  30) RBFS File data type symbol can be detected
     Failure/Error: subject(:file) { RBFS::File.new }
     ArgumentError:
       wrong number of arguments (0 for 1)
     # /tmp/d20141111-26053-10a436n/solution.rb:5:in `initialize'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `new'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:263: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)>'

  31) RBFS File data type symbol can be serialized
     Failure/Error: subject(:file) { RBFS::File.new }
     ArgumentError:
       wrong number of arguments (0 for 1)
     # /tmp/d20141111-26053-10a436n/solution.rb:5:in `initialize'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `new'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:263: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)>'

  32) RBFS File data type symbol can be parsed
     Failure/Error: subject(:file) { RBFS::File.new }
     ArgumentError:
       wrong number of arguments (0 for 1)
     # /tmp/d20141111-26053-10a436n/solution.rb:5:in `initialize'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `new'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:263: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)>'

  33) RBFS File data type number can be detected
     Failure/Error: subject(:file) { RBFS::File.new }
     ArgumentError:
       wrong number of arguments (0 for 1)
     # /tmp/d20141111-26053-10a436n/solution.rb:5:in `initialize'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `new'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:282: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)>'

  34) RBFS File data type number can be serialized
     Failure/Error: subject(:file) { RBFS::File.new }
     ArgumentError:
       wrong number of arguments (0 for 1)
     # /tmp/d20141111-26053-10a436n/solution.rb:5:in `initialize'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `new'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:282: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)>'

  35) RBFS File data type number can be parsed
     Failure/Error: subject(:file) { RBFS::File.new }
     ArgumentError:
       wrong number of arguments (0 for 1)
     # /tmp/d20141111-26053-10a436n/solution.rb:5:in `initialize'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `new'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:282: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)>'

  36) RBFS File data type float number can be detected
     Failure/Error: subject(:file) { RBFS::File.new }
     ArgumentError:
       wrong number of arguments (0 for 1)
     # /tmp/d20141111-26053-10a436n/solution.rb:5:in `initialize'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `new'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:301: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)>'

  37) RBFS File data type float number can be serialized
     Failure/Error: subject(:file) { RBFS::File.new }
     ArgumentError:
       wrong number of arguments (0 for 1)
     # /tmp/d20141111-26053-10a436n/solution.rb:5:in `initialize'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `new'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:301: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)>'

  38) RBFS File data type float number can be parsed
     Failure/Error: subject(:file) { RBFS::File.new }
     ArgumentError:
       wrong number of arguments (0 for 1)
     # /tmp/d20141111-26053-10a436n/solution.rb:5:in `initialize'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `new'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:301: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)>'

  39) RBFS File data type boolean true can be detected
     Failure/Error: subject(:file) { RBFS::File.new }
     ArgumentError:
       wrong number of arguments (0 for 1)
     # /tmp/d20141111-26053-10a436n/solution.rb:5:in `initialize'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `new'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:322: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)>'

  40) RBFS File data type boolean true can be serialized
     Failure/Error: subject(:file) { RBFS::File.new }
     ArgumentError:
       wrong number of arguments (0 for 1)
     # /tmp/d20141111-26053-10a436n/solution.rb:5:in `initialize'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `new'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:327: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)>'

  41) RBFS File data type boolean true can be parsed
     Failure/Error: file = RBFS::File.parse('boolean:true')
     NoMethodError:
       undefined method `parse' for RBFS::File:Class
     # /tmp/d20141111-26053-10a436n/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)>'

  42) RBFS File data type boolean false can be detected
     Failure/Error: subject(:file) { RBFS::File.new }
     ArgumentError:
       wrong number of arguments (0 for 1)
     # /tmp/d20141111-26053-10a436n/solution.rb:5:in `initialize'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `new'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:341: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)>'

  43) RBFS File data type boolean false can be serialized
     Failure/Error: subject(:file) { RBFS::File.new }
     ArgumentError:
       wrong number of arguments (0 for 1)
     # /tmp/d20141111-26053-10a436n/solution.rb:5:in `initialize'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `new'
     # /tmp/d20141111-26053-10a436n/spec.rb:200:in `block (3 levels) in <top (required)>'
     # /tmp/d20141111-26053-10a436n/spec.rb:346: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)>'

  44) RBFS File data type boolean false can be parsed
     Failure/Error: file = RBFS::File.parse('boolean:false')
     NoMethodError:
       undefined method `parse' for RBFS::File:Class
     # /tmp/d20141111-26053-10a436n/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.03887 seconds
44 examples, 44 failures

Failed examples:

rspec /tmp/d20141111-26053-10a436n/spec.rb:141 # RBFS Directory can add a file
rspec /tmp/d20141111-26053-10a436n/spec.rb:149 # RBFS Directory can create empty directory
rspec /tmp/d20141111-26053-10a436n/spec.rb:156 # RBFS Directory can add a directory
rspec /tmp/d20141111-26053-10a436n/spec.rb:6 # RBFS Directory without files returns empty hash for the files
rspec /tmp/d20141111-26053-10a436n/spec.rb:10 # RBFS Directory without files can be serialized
rspec /tmp/d20141111-26053-10a436n/spec.rb:16 # RBFS Directory without directories returns empty hash for the directories
rspec /tmp/d20141111-26053-10a436n/spec.rb:33 # RBFS Directory with files and directories returns correct file hash
rspec /tmp/d20141111-26053-10a436n/spec.rb:37 # RBFS Directory with files and directories returns correct directory hash
rspec /tmp/d20141111-26053-10a436n/spec.rb:76 # RBFS Directory serialization #serialize can serialize
rspec /tmp/d20141111-26053-10a436n/spec.rb:84 # RBFS Directory serialization #serialize can serialize multiple directories recursively
rspec /tmp/d20141111-26053-10a436n/spec.rb:100 # RBFS Directory serialization ::parse can parse empty directories
rspec /tmp/d20141111-26053-10a436n/spec.rb:107 # RBFS Directory serialization ::parse can parse directories with files
rspec /tmp/d20141111-26053-10a436n/spec.rb:116 # RBFS Directory serialization ::parse can parse directory trees without files
rspec /tmp/d20141111-26053-10a436n/spec.rb:124 # RBFS Directory serialization ::parse can parse directories recursively
rspec /tmp/d20141111-26053-10a436n/spec.rb:177 # RBFS Directory #[] can walk a single directory
rspec /tmp/d20141111-26053-10a436n/spec.rb:181 # RBFS Directory #[] can walk multiple directories
rspec /tmp/d20141111-26053-10a436n/spec.rb:185 # RBFS Directory #[] can get files
rspec /tmp/d20141111-26053-10a436n/spec.rb:189 # RBFS Directory #[] returns nil if directory or file doesnt exist
rspec /tmp/d20141111-26053-10a436n/spec.rb:193 # RBFS Directory #[] is case-sensitive
rspec /tmp/d20141111-26053-10a436n/spec.rb:202 # RBFS File has nil as initial data
rspec /tmp/d20141111-26053-10a436n/spec.rb:206 # RBFS File can store data
rspec /tmp/d20141111-26053-10a436n/spec.rb:211 # RBFS File can accept data in the initializer
rspec /tmp/d20141111-26053-10a436n/spec.rb:221 # RBFS File data type nil can be detected
rspec /tmp/d20141111-26053-10a436n/spec.rb:225 # RBFS File data type nil can be serialized
rspec /tmp/d20141111-26053-10a436n/spec.rb:229 # RBFS File data type nil can be parsed
rspec /tmp/d20141111-26053-10a436n/spec.rb:239 # RBFS File data type string can be detected
rspec /tmp/d20141111-26053-10a436n/spec.rb:243 # RBFS File data type string can be serialized
rspec /tmp/d20141111-26053-10a436n/spec.rb:247 # RBFS File data type string can be parsed
rspec /tmp/d20141111-26053-10a436n/spec.rb:254 # RBFS File data type string can parse a string with colons
rspec /tmp/d20141111-26053-10a436n/spec.rb:265 # RBFS File data type symbol can be detected
rspec /tmp/d20141111-26053-10a436n/spec.rb:269 # RBFS File data type symbol can be serialized
rspec /tmp/d20141111-26053-10a436n/spec.rb:273 # RBFS File data type symbol can be parsed
rspec /tmp/d20141111-26053-10a436n/spec.rb:284 # RBFS File data type number can be detected
rspec /tmp/d20141111-26053-10a436n/spec.rb:288 # RBFS File data type number can be serialized
rspec /tmp/d20141111-26053-10a436n/spec.rb:292 # RBFS File data type number can be parsed
rspec /tmp/d20141111-26053-10a436n/spec.rb:303 # RBFS File data type float number can be detected
rspec /tmp/d20141111-26053-10a436n/spec.rb:307 # RBFS File data type float number can be serialized
rspec /tmp/d20141111-26053-10a436n/spec.rb:311 # RBFS File data type float number can be parsed
rspec /tmp/d20141111-26053-10a436n/spec.rb:321 # RBFS File data type boolean true can be detected
rspec /tmp/d20141111-26053-10a436n/spec.rb:326 # RBFS File data type boolean true can be serialized
rspec /tmp/d20141111-26053-10a436n/spec.rb:331 # RBFS File data type boolean true can be parsed
rspec /tmp/d20141111-26053-10a436n/spec.rb:340 # RBFS File data type boolean false can be detected
rspec /tmp/d20141111-26053-10a436n/spec.rb:345 # RBFS File data type boolean false can be serialized
rspec /tmp/d20141111-26053-10a436n/spec.rb:350 # RBFS File data type boolean false can be parsed

История (7 версии и 0 коментара)

Ралица обнови решението на 10.11.2014 16:13 (преди около 10 години)

+module RBFS
+end
+
+class RBFS::File
+ def initialize(object)
+ @content = object.serialize
+ end
+
+ def serialize
+ if object != undefined
+ @content << data_type(object) + ":" + object.serialize
+ end
+ end
+
+ def data_type
+ case @content
+ when String then @data_type = :string
+ when Symbol then @data_type = :symbol
+ when Float then @data_type = :number
+ when Integer then @data_type = :number
+ when Boolean then @data_type = :boolean
+ else :nil
+ end
+ end
+end

Ралица обнови решението на 10.11.2014 16:18 (преди около 10 години)

module RBFS
end
class RBFS::File
def initialize(object)
@content = object.serialize
end
def serialize
if object != undefined
- @content << data_type(object) + ":" + object.serialize
+ @content << data_type(object) + ":" + object.to_s
end
end
def data_type
case @content
when String then @data_type = :string
when Symbol then @data_type = :symbol
when Float then @data_type = :number
when Integer then @data_type = :number
when Boolean then @data_type = :boolean
else :nil
end
end
end

Ралица обнови решението на 10.11.2014 16:20 (преди около 10 години)

module RBFS
end
class RBFS::File
def initialize(object)
@content = object.serialize
end
- def serialize
+ def serialize(object)
if object != undefined
@content << data_type(object) + ":" + object.to_s
end
end
def data_type
case @content
when String then @data_type = :string
when Symbol then @data_type = :symbol
when Float then @data_type = :number
when Integer then @data_type = :number
when Boolean then @data_type = :boolean
else :nil
end
end
end

Ралица обнови решението на 10.11.2014 16:41 (преди около 10 години)

-module RBFS
-end
+#
-
-class RBFS::File
- def initialize(object)
- @content = object.serialize
- end
-
- def serialize(object)
- if object != undefined
- @content << data_type(object) + ":" + object.to_s
- end
- end
-
- def data_type
- case @content
- when String then @data_type = :string
- when Symbol then @data_type = :symbol
- when Float then @data_type = :number
- when Integer then @data_type = :number
- when Boolean then @data_type = :boolean
- else :nil
- end
- end
-end

Ралица обнови решението на 10.11.2014 16:48 (преди около 10 години)

-#
+module RBFS
+end
+
+class RBFS::File
+ def initialize(object)
+ @content = object.serialize
+ end
+
+ def serialize(object)
+ if object != undefined
+ @content << data_type(object) + ":" + object.serialize
+ end
+ end
+
+ def data_type
+ @hash = {String: :string, Float: :number,
+ Integer: :number, Symbol: :symbol, Boolean: :boolean}
+ @hash[@data_type] || :nil
+ end
+
+ def parse(string_data)
+ File.new(string_data)
+ end
+end

Ралица обнови решението на 10.11.2014 16:49 (преди около 10 години)

module RBFS
end
class RBFS::File
def initialize(object)
- @content = object.serialize
+ @content = object.serialize
end
def serialize(object)
- if object != undefined
- @content << data_type(object) + ":" + object.serialize
+ if object != undefined
+ @content << data_type(object) + ":" + object.serialize
end
end
def data_type
@hash = {String: :string, Float: :number,
Integer: :number, Symbol: :symbol, Boolean: :boolean}
@hash[@data_type] || :nil
end
def parse(string_data)
File.new(string_data)
end
end

Ралица обнови решението на 10.11.2014 16:50 (преди около 10 години)

module RBFS
end
class RBFS::File
def initialize(object)
@content = object.serialize
end
- def serialize(object)
- if object != undefined
- @content << data_type(object) + ":" + object.serialize
- end
- end
-
def data_type
@hash = {String: :string, Float: :number,
Integer: :number, Symbol: :symbol, Boolean: :boolean}
@hash[@data_type] || :nil
- end
-
- def parse(string_data)
- File.new(string_data)
end
end