Решение на Пета задача от Ивайло Чернев
Обратно към всички решения
Към профила на Ивайло Чернев
Резултати
- 5 точки от тестове
- 1 отнета точка
- 4 точки общо
- 25 успешни тест(а)
- 5 неуспешни тест(а)
Код
Лог от изпълнението
.......FFFFF..................
Failures:
1) ObjectStore cannot show head for empty repository
Failure/Error: expect(repo.head).to be_error("Branch master does not have any commits yet.")
expected #<RepoResult:0x007fb11e894550 @message="Branch does not have any commits yet.", @status=false, @result=nil> to be error "Branch master does not have any commits yet."
# /tmp/d20160111-5693-166uwjh/spec.rb:74: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 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 #<RepoResult:0x007fb11e880c80 @message="Commit c37b43e59489a89b1b473bdbca810299a402d589\nDate: Mon Jan 11 11:54 2016 +0200\n\n\tSo cool!", @status=true, @result=nil> to be success "Commit 381573fc6aa4a6bb947e617a74fc4e0a5e152245\nDate: Mon Jan 11 11:54 2016 +0200\n\n\tSo cool!"
# /tmp/d20160111-5693-166uwjh/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)>'
3) 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 #<RepoResult:0x007fb11e852380 @message="Commit c37b43e59489a89b1b473bdbca810299a402d589\nDate: Mon Jan 11 11:54 2016 +0200\n\n\tSo cool!", @status=true, @result=nil> to be success "Commit 381573fc6aa4a6bb947e617a74fc4e0a5e152245\nDate: Mon Jan 11 11:54 2016 +0200\n\n\tSo cool!"
# /tmp/d20160111-5693-166uwjh/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)>'
4) 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 #<RepoResult:0x007fb11e8128e8 @message="Commit 216936f23824cf8aae17ab745091ca1bd3ebdd6b\nDate: Mon Jan 11 11:54 2016 +0200\n\n\tSecond commit\n\nCommit 48e44060a740b5dff91925fc890689892c9c8e52\nDate: Mon Jan 11 11:54 2016 +0200\n\n\tFirst commit", @status=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-166uwjh/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)>'
5) ObjectStore shows the log for the current branch only
Failure/Error: expect(repo.log).to be_success("Commit #{commit1_hash}\nDate: #{current_time}\n\n\tFirst commit")
expected #<RepoResult:0x007fb11e7f9190 @message="Commit 48e44060a740b5dff91925fc890689892c9c8e52\nDate: Mon Jan 11 11:54 2016 +0200\n\n\tFirst commit", @status=true, @result=nil> to be success "Commit 48bd765d675f355375408e84d12573236b16ddc2\nDate: Mon Jan 11 11:54 2016 +0200\n\n\tFirst commit"
# /tmp/d20160111-5693-166uwjh/spec.rb:128: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.03303 seconds
30 examples, 5 failures
Failed examples:
rspec /tmp/d20160111-5693-166uwjh/spec.rb:72 # ObjectStore cannot show head for empty repository
rspec /tmp/d20160111-5693-166uwjh/spec.rb:77 # ObjectStore can show log of changes for a single commit
rspec /tmp/d20160111-5693-166uwjh/spec.rb:86 # ObjectStore can show log of changes for a single commit
rspec /tmp/d20160111-5693-166uwjh/spec.rb:95 # ObjectStore can show log of changes for multiple commits
rspec /tmp/d20160111-5693-166uwjh/spec.rb:111 # ObjectStore shows the log for the current branch only
История (1 версия и 4 коментара)
Ивайло обнови решението на 23.11.2015 17:27 (преди около 9 години)