Решение на Пета задача от Слави Боянов
Обратно към всички решения
Към профила на Слави Боянов
Резултати
- 2 точки от тестове
- 0 бонус точки
- 2 точки общо
- 11 успешни тест(а)
- 19 неуспешни тест(а)
Код
Лог от изпълнението
...FFF..FFFF.FFFFFFFF..FFF...F
Failures:
1) ObjectStore can remove objects
Failure/Error: expect(repo.remove("object1")).to be_success("Added object1 for removal.", "content1")
NoMethodError:
undefined method `hash_key' for {:object1=>"content1", :object2=>"content2"}:Hash
# /tmp/d20160111-5693-11arrvw/solution.rb:134:in `remove'
# /tmp/d20160111-5693-11arrvw/spec.rb:43:in `block (2 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) ObjectStore can commit changes which include only removed objects
Failure/Error: repo.remove("object2")
NoMethodError:
undefined method `hash_key' for {:object1=>"content1", :object2=>"content2"}:Hash
# /tmp/d20160111-5693-11arrvw/solution.rb:134:in `remove'
# /tmp/d20160111-5693-11arrvw/spec.rb:52:in `block (2 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) ObjectStore cannot remove objects that are not committed
Failure/Error: expect(repo.remove("object2")).to be_error("Object object2 is not committed.")
NoMethodError:
undefined method `hash_key' for {:object1=>"content1"}:Hash
# /tmp/d20160111-5693-11arrvw/solution.rb:134:in `remove'
# /tmp/d20160111-5693-11arrvw/spec.rb:60:in `block (2 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) ObjectStore can show log of changes for a single commit
Failure/Error: expect(repo.log).to be_success("Commit #{commit_hash}\nDate: #{Time.now.strftime("%a %b %d %H:%M %Y %z")}\n\n\tSo cool!")
expected #<Information:0x007f18046cc2f8 @message="Commit 6daacf9f2001f9d36ed38e3354379bc218a2ee10\nDate: 2016-01-11 11:54:44 +0200\n\n\tSo cool!", @success=true, @result=nil> to be success "Commit 381573fc6aa4a6bb947e617a74fc4e0a5e152245\nDate: Mon Jan 11 11:54 2016 +0200\n\n\tSo cool!"
# /tmp/d20160111-5693-11arrvw/spec.rb:83:in `block (2 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) ObjectStore can show log of changes for a single commit
Failure/Error: expect(repo.log).to be_success("Commit #{commit_hash}\nDate: #{Time.now.strftime("%a %b %d %H:%M %Y %z")}\n\n\tSo cool!")
expected #<Information:0x007f18046a9050 @message="Commit 6daacf9f2001f9d36ed38e3354379bc218a2ee10\nDate: 2016-01-11 11:54:44 +0200\n\n\tSo cool!", @success=true, @result=nil> to be success "Commit 381573fc6aa4a6bb947e617a74fc4e0a5e152245\nDate: Mon Jan 11 11:54 2016 +0200\n\n\tSo cool!"
# /tmp/d20160111-5693-11arrvw/spec.rb:92:in `block (2 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) ObjectStore can show log of changes for multiple commits
Failure/Error: expect(repo.log).to be_success("Commit #{commit2_hash}\nDate: #{current_time}\n\n\tSecond commit\n\nCommit #{commit1_hash}\nDate: #{current_time}\n\n\tFirst commit")
expected #<Information:0x007f18046a2b38 @message="Commit dace301d434cc5bd6021cccd7f8b90dda9f0fbd9\nDate: 2016-01-11 11:54:44 +0200\n\n\tFirst commit\n\nCommit 70ed96640b3f6e95bf5b3335cc014c16b9216896\nDate: 2016-01-11 11:54:44 +0200\n\n\tSecond commit", @success=true, @result=nil> to be success "Commit ffeb5391d1ec154dd4a821a1aeed876cad514a0d\nDate: Mon Jan 11 11:54 2016 +0200\n\n\tSecond commit\n\nCommit 48bd765d675f355375408e84d12573236b16ddc2\nDate: Mon Jan 11 11:54 2016 +0200\n\n\tFirst commit"
# /tmp/d20160111-5693-11arrvw/spec.rb:108:in `block (2 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) ObjectStore shows the log for the current branch only
Failure/Error: repo.branch.create("develop")
NoMethodError:
undefined method `has_key' for #<Hash:0x007f180469ccd8>
# /tmp/d20160111-5693-11arrvw/solution.rb:65:in `create'
# /tmp/d20160111-5693-11arrvw/spec.rb:116:in `block (2 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) ObjectStore can list branches
Failure/Error: repo.branch.create("develop")
NoMethodError:
undefined method `has_key' for #<Hash:0x007f180468c7e8>
# /tmp/d20160111-5693-11arrvw/solution.rb:65:in `create'
# /tmp/d20160111-5693-11arrvw/spec.rb:138:in `block (2 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) ObjectStore can create branches
Failure/Error: expect(repo.branch.create("develop")).to be_success("Created branch develop.")
NoMethodError:
undefined method `has_key' for #<Hash:0x007f18046895c0>
# /tmp/d20160111-5693-11arrvw/solution.rb:65:in `create'
# /tmp/d20160111-5693-11arrvw/spec.rb:145:in `block (2 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) ObjectStore cannot create branch if already exists
Failure/Error: expect(repo.branch.create("master")).to be_error("Branch master already exists.")
NoMethodError:
undefined method `has_key' for #<Hash:0x007f18046626a0>
# /tmp/d20160111-5693-11arrvw/solution.rb:65:in `create'
# /tmp/d20160111-5693-11arrvw/spec.rb:150:in `block (2 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) ObjectStore can switch branches
Failure/Error: repo.branch.create("develop")
NoMethodError:
undefined method `has_key' for #<Hash:0x007f180465f6f8>
# /tmp/d20160111-5693-11arrvw/solution.rb:65:in `create'
# /tmp/d20160111-5693-11arrvw/spec.rb:157:in `block (2 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) ObjectStore cannot switch to nonexisting branch
Failure/Error: expect(repo.branch.checkout("develop")).to be_error("Branch develop does not exist.")
expected #<Information:0x007f180465d2b8 @message="Branch develop does not exist", @success=false, @result=nil> to be error "Branch develop does not exist."
# /tmp/d20160111-5693-11arrvw/spec.rb:168:in `block (2 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) ObjectStore can remove branch
Failure/Error: repo.branch.create("develop")
NoMethodError:
undefined method `has_key' for #<Hash:0x007f1804329128>
# /tmp/d20160111-5693-11arrvw/solution.rb:65:in `create'
# /tmp/d20160111-5693-11arrvw/spec.rb:173:in `block (2 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) ObjectStore cannot remove current branch
Failure/Error: expect(repo.branch.remove("master")).to be_error("Cannot remove current branch.")
expected #<Information:0x007f1804125098 @message="Can't remove current branch.", @success=false, @result=nil> to be error "Cannot remove current branch."
# /tmp/d20160111-5693-11arrvw/spec.rb:179:in `block (2 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) ObjectStore cannot remove nonexisting branch
Failure/Error: expect(repo.branch.remove("develop")).to be_error("Branch develop does not exist.")
NoMethodError:
undefined method `has_key' for #<Hash:0x007f1804314110>
# /tmp/d20160111-5693-11arrvw/solution.rb:85:in `remove'
# /tmp/d20160111-5693-11arrvw/spec.rb:184:in `block (2 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) ObjectStore cannot return not committed objects
Failure/Error: expect(repo.get("string")).to be_error("Object string is not committed.")
expected #<Information:0x007f18042bdb30 @message="Object string is not commited.", @success=false, @result=nil> to be error "Object string is not committed."
# /tmp/d20160111-5693-11arrvw/spec.rb:209:in `block (2 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) ObjectStore cannot return objects when no commits
Failure/Error: expect(repo.get("string")).to be_error("Object string is not committed.")
expected #<Information:0x007f18042a03f0 @message="Object string is not commited.", @success=false, @result=nil> to be error "Object string is not committed."
# /tmp/d20160111-5693-11arrvw/spec.rb:214:in `block (2 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) ObjectStore can checkout commits
Failure/Error: expect(repo.checkout(first_commit.hash)).to be_success("HEAD is now at #{first_commit.hash}.", first_commit)
expected #<Information:0x007f1804256d40 @message="HEAD is now at dace301d434cc5bd6021cccd7f8b90dda9f0fbd9", @success=true, @result=#<Commit:0x007f1804268158 @content={:number=>42}, @message="First commit", @date=2016-01-11 11:54:44 +0200, @hash="dace301d434cc5bd6021cccd7f8b90dda9f0fbd9">> to be success "HEAD is now at dace301d434cc5bd6021cccd7f8b90dda9f0fbd9." and #<Commit:0x007f1804268158 @content={:number=>42}, @message="First commit", @date=2016-01-11 11:54:44 +0200, @hash="dace301d434cc5bd6021cccd7f8b90dda9f0fbd9">
# /tmp/d20160111-5693-11arrvw/spec.rb:223:in `block (2 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) ObjectStore can show the objects of a repo after removing an object
Failure/Error: repo.remove("object2")
NoMethodError:
undefined method `hash_key' for #<Hash:0x007f180418a9c0>
# /tmp/d20160111-5693-11arrvw/solution.rb:134:in `remove'
# /tmp/d20160111-5693-11arrvw/spec.rb:261:in `block (2 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.02839 seconds
30 examples, 19 failures
Failed examples:
rspec /tmp/d20160111-5693-11arrvw/spec.rb:38 # ObjectStore can remove objects
rspec /tmp/d20160111-5693-11arrvw/spec.rb:46 # ObjectStore can commit changes which include only removed objects
rspec /tmp/d20160111-5693-11arrvw/spec.rb:56 # ObjectStore cannot remove objects that are not committed
rspec /tmp/d20160111-5693-11arrvw/spec.rb:77 # ObjectStore can show log of changes for a single commit
rspec /tmp/d20160111-5693-11arrvw/spec.rb:86 # ObjectStore can show log of changes for a single commit
rspec /tmp/d20160111-5693-11arrvw/spec.rb:95 # ObjectStore can show log of changes for multiple commits
rspec /tmp/d20160111-5693-11arrvw/spec.rb:111 # ObjectStore shows the log for the current branch only
rspec /tmp/d20160111-5693-11arrvw/spec.rb:136 # ObjectStore can list branches
rspec /tmp/d20160111-5693-11arrvw/spec.rb:143 # ObjectStore can create branches
rspec /tmp/d20160111-5693-11arrvw/spec.rb:148 # ObjectStore cannot create branch if already exists
rspec /tmp/d20160111-5693-11arrvw/spec.rb:153 # ObjectStore can switch branches
rspec /tmp/d20160111-5693-11arrvw/spec.rb:166 # ObjectStore cannot switch to nonexisting branch
rspec /tmp/d20160111-5693-11arrvw/spec.rb:171 # ObjectStore can remove branch
rspec /tmp/d20160111-5693-11arrvw/spec.rb:177 # ObjectStore cannot remove current branch
rspec /tmp/d20160111-5693-11arrvw/spec.rb:182 # ObjectStore cannot remove nonexisting branch
rspec /tmp/d20160111-5693-11arrvw/spec.rb:205 # ObjectStore cannot return not committed objects
rspec /tmp/d20160111-5693-11arrvw/spec.rb:212 # ObjectStore cannot return objects when no commits
rspec /tmp/d20160111-5693-11arrvw/spec.rb:217 # ObjectStore can checkout commits
rspec /tmp/d20160111-5693-11arrvw/spec.rb:253 # ObjectStore can show the objects of a repo after removing an object
История (1 версия и 0 коментара)
Слави обнови решението на 23.11.2015 16:04 (преди около 9 години)