Решение на Пета задача от Мирослав Лалев
Обратно към всички решения
Към профила на Мирослав Лалев
Резултати
- 0 точки от тестове
- 0 бонус точки
- 0 точки общо
- 0 успешни тест(а)
- 30 неуспешни тест(а)
Код
Лог от изпълнението
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
Failures:
1) ObjectStore can add objects
Failure/Error: expect(repo.add("object", "content")).to be_success("Added object to stage.", "content")
expected #<Response:0x007fdc9340f598 @message="Added object to stage.", @result=#<Change:0x007fdc9340f5e8 @name="object", @object="content", @type=:add>> to be success "Added object to stage." and "content"
# /tmp/d20160111-5693-7h360d/spec.rb:23: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 objects
Failure/Error: expect(repo.commit("So cool!")).to be_success("So cool!\n\t2 objects changed", repo.head.result)
expected #<Response:0x007fdc93409760 @message="So cool!\n\t2 objects changed", @result=[#<Commit:0x007fdc93409a08 @message="So cool!", @date="Mon Jan 11 11:54 2016 +0000", @hash="8d716d10b8c311cefbd338ecb4c8b3dbe800c150", @objects=[#<Change:0x007fdc93409be8 @name="object2", @object="content2", @type=:add>, #<Change:0x007fdc93409cd8 @name="object1", @object="content1", @type=:add>]>]> to be success "So cool!\n\t2 objects changed" and "So cool!\n\t2 objects changed"
# /tmp/d20160111-5693-7h360d/spec.rb:30: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 commit without changed objects
Failure/Error: result.success? == false &&
NoMethodError:
undefined method `success?' for #<Response:0x007fdc933ef298>
# /tmp/d20160111-5693-7h360d/spec.rb:16:in `block (3 levels) in <top (required)>'
# /tmp/d20160111-5693-7h360d/spec.rb:35: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 remove objects
Failure/Error: expect(repo.remove("object1")).to be_success("Added object1 for removal.", "content1")
expected #<Response:0x007fdc9307fb58 @message="Added object1 for removal.", @result=#<Change:0x007fdc9307fbd0 @name="object1", @object=nil, @type=:remove>> to be success "Added object1 for removal." and "content1"
# /tmp/d20160111-5693-7h360d/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)>'
5) ObjectStore can commit changes which include only removed objects
Failure/Error: expect(repo.commit("Removed object2")).to be_success("Removed object2\n\t1 objects changed", repo.head.result)
expected #<Response:0x007fdc93065f50 @message="Removed object2\n\t1 objects changed", @result=[#<Commit:0x007fdc93067508 @message="Removed object2", @date="Mon Jan 11 11:54 2016 +0000", @hash="4b755f67ef71e686fd0bdaa7de55c4d9c52105a7", @objects=[#<Change:0x007fdc930678a0 @name="object2", @object=nil, @type=:remove>]>, #<Commit:0x007fdc930684a8 @message="So cool!", @date="Mon Jan 11 11:54 2016 +0000", @hash="8d716d10b8c311cefbd338ecb4c8b3dbe800c150", @objects=[#<Change:0x007fdc93068778 @name="object2", @object="content2", @type=:add>, #<Change:0x007fdc93068a48 @name="object1", @object="content1", @type=:add>]>]> to be success "Removed object2\n\t1 objects changed" and "Removed object2\n\t1 objects changed"
# /tmp/d20160111-5693-7h360d/spec.rb:53: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 cannot remove objects that are not committed
Failure/Error: result.success? == false &&
NoMethodError:
undefined method `success?' for #<Response:0x007fdc930440f8>
# /tmp/d20160111-5693-7h360d/spec.rb:16:in `block (3 levels) in <top (required)>'
# /tmp/d20160111-5693-7h360d/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)>'
7) ObjectStore can show head
Failure/Error: expect(repo.head).to be_success("There we go", last_commit)
expected #<Commit:0x007fdc93021a80 @message="There we go", @date="Mon Jan 11 11:54 2016 +0000", @hash="05aaf1c110b12b6d9ec9ba2e5c90a7482fdf73a2", @objects=[#<Change:0x007fdc93021e90 @name="object2", @object="content2", @type=:add>]> to be success "There we go" and [#<Commit:0x007fdc93021a80 @message="There we go", @date="Mon Jan 11 11:54 2016 +0000", @hash="05aaf1c110b12b6d9ec9ba2e5c90a7482fdf73a2", @objects=[#<Change:0x007fdc93021e90 @name="object2", @object="content2", @type=:add>]>, #<Commit:0x007fdc93022908 @message="First part... more to come...", @date="Mon Jan 11 11:54 2016 +0000", @hash="4ea2b564fb99515666c3cbee4f89b08a5da211ce", @objects=[#<Change:0x007fdc93022c28 @name="object1", @object="content1", @type=:add>]>]
# /tmp/d20160111-5693-7h360d/spec.rb:69: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 cannot show head for empty repository
Failure/Error: result.message == message &&
NoMethodError:
undefined method `message' for "Branch master does not have any commits yet.":String
# /tmp/d20160111-5693-7h360d/spec.rb:15:in `block (3 levels) in <top (required)>'
# /tmp/d20160111-5693-7h360d/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)>'
9) ObjectStore can show log of changes for a single commit
Failure/Error: commit_hash = Digest::SHA1.hexdigest("#{commit.date.strftime("%a %b %d %H:%M %Y %z")}#{commit.message}")
NoMethodError:
undefined method `date' for #<Array:0x007fdc92fe9c48>
# /tmp/d20160111-5693-7h360d/spec.rb:82: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 can show log of changes for a single commit
Failure/Error: commit_hash = Digest::SHA1.hexdigest("#{commit.date.strftime("%a %b %d %H:%M %Y %z")}#{commit.message}")
NoMethodError:
undefined method `date' for #<Array:0x007fdc92fc12c0>
# /tmp/d20160111-5693-7h360d/spec.rb:91: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 show log of changes for multiple commits
Failure/Error: commit1_hash = Digest::SHA1.hexdigest("#{commit1.date.strftime(time_format)}#{commit1.message}")
NoMethodError:
undefined method `date' for #<Array:0x007fdc92f8e2a8>
# /tmp/d20160111-5693-7h360d/spec.rb:105: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 shows the log for the current branch only
Failure/Error: commit1_hash = Digest::SHA1.hexdigest("#{commit1.date.strftime(time_format)}#{commit1.message}")
NoMethodError:
undefined method `date' for #<Array:0x007fdc92f78430>
# /tmp/d20160111-5693-7h360d/spec.rb:126: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 cannot show log for empty repository
Failure/Error: expect(repo.log).to be_error("Branch master does not have any commits yet.")
expected #<Response:0x007fdc92f6fc90 @message="Branch masterdoes not have any commits yet.", @result=nil> to be error "Branch master does not have any commits yet."
# /tmp/d20160111-5693-7h360d/spec.rb:133: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 can list branches
Failure/Error: actual.message == message &&
NoMethodError:
undefined method `message' for "\t\tdevelop\nfeature\n\t*master":String
# /tmp/d20160111-5693-7h360d/spec.rb:6:in `block (3 levels) in <top (required)>'
# /tmp/d20160111-5693-7h360d/spec.rb:140: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 can create branches
Failure/Error: actual.success? == true &&
NoMethodError:
undefined method `success?' for #<Response:0x007fdc92eca038>
# /tmp/d20160111-5693-7h360d/spec.rb:8:in `block (3 levels) in <top (required)>'
# /tmp/d20160111-5693-7h360d/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)>'
16) ObjectStore cannot create branch if already exists
Failure/Error: result.success? == false &&
NoMethodError:
undefined method `success?' for #<Response:0x007fdc92eb90a8>
# /tmp/d20160111-5693-7h360d/spec.rb:16:in `block (3 levels) in <top (required)>'
# /tmp/d20160111-5693-7h360d/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)>'
17) ObjectStore can switch branches
Failure/Error: actual.success? == true &&
NoMethodError:
undefined method `success?' for #<Response:0x007fdc92e843f8>
# /tmp/d20160111-5693-7h360d/spec.rb:8:in `block (3 levels) in <top (required)>'
# /tmp/d20160111-5693-7h360d/spec.rb:158: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 cannot switch to nonexisting branch
Failure/Error: result.success? == false &&
NoMethodError:
undefined method `success?' for #<Response:0x007fdc92ca4128>
# /tmp/d20160111-5693-7h360d/spec.rb:16:in `block (3 levels) in <top (required)>'
# /tmp/d20160111-5693-7h360d/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)>'
19) ObjectStore can remove branch
Failure/Error: actual.success? == true &&
NoMethodError:
undefined method `success?' for #<Response:0x007fdc92c8fd68>
# /tmp/d20160111-5693-7h360d/spec.rb:8:in `block (3 levels) in <top (required)>'
# /tmp/d20160111-5693-7h360d/spec.rb:174: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)>'
20) ObjectStore cannot remove current branch
Failure/Error: result.success? == false &&
NoMethodError:
undefined method `success?' for #<Response:0x007fdc92c80bb0>
# /tmp/d20160111-5693-7h360d/spec.rb:16:in `block (3 levels) in <top (required)>'
# /tmp/d20160111-5693-7h360d/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)>'
21) ObjectStore cannot remove nonexisting branch
Failure/Error: result.success? == false &&
NoMethodError:
undefined method `success?' for #<Response:0x007fdc92c72d80>
# /tmp/d20160111-5693-7h360d/spec.rb:16:in `block (3 levels) in <top (required)>'
# /tmp/d20160111-5693-7h360d/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)>'
22) ObjectStore can be initialized with block
Failure/Error: expect(repo.head).to be_success("Second commit", $second_commit)
expected #<Commit:0x007fdc93aac950 @message="Second commit", @date="Mon Jan 11 11:54 2016 +0000", @hash="a7b79fee10c0ac1228111d6d6474a3dc94082557", @objects=[#<Change:0x007fdc93aacd10 @name="object2", @object="content", @type=:add>]> to be success "Second commit" and [#<Commit:0x007fdc93aac950 @message="Second commit", @date="Mon Jan 11 11:54 2016 +0000", @hash="a7b79fee10c0ac1228111d6d6474a3dc94082557", @objects=[#<Change:0x007fdc93aacd10 @name="object2", @object="content", @type=:add>]>, #<Commit:0x007fdc93aadb48 @message="First commit", @date="Mon Jan 11 11:54 2016 +0000", @hash="62ed7556a4eb9bf5584cac4df619c5d0d007a107", @objects=[#<Change:0x007fdc93aadda0 @name="object1", @object="content1", @type=:add>]>]
# /tmp/d20160111-5693-7h360d/spec.rb:195: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)>'
23) ObjectStore can return objects
Failure/Error: expect(repo.get("number")).to be_success("Found object number.", 21)
NoMethodError:
undefined method `get' for #<Branch:0x007fdc93b2f0f8>
# /tmp/d20160111-5693-7h360d/solution.rb:53:in `get'
# /tmp/d20160111-5693-7h360d/spec.rb:202: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)>'
24) ObjectStore cannot return not committed objects
Failure/Error: expect(repo.get("string")).to be_error("Object string is not committed.")
NoMethodError:
undefined method `get' for #<Branch:0x007fdc93b2cb00>
# /tmp/d20160111-5693-7h360d/solution.rb:53:in `get'
# /tmp/d20160111-5693-7h360d/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)>'
25) ObjectStore cannot return objects when no commits
Failure/Error: expect(repo.get("string")).to be_error("Object string is not committed.")
NoMethodError:
undefined method `get' for #<Branch:0x007fdc93b45cb8>
# /tmp/d20160111-5693-7h360d/solution.rb:53:in `get'
# /tmp/d20160111-5693-7h360d/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)>'
26) ObjectStore can checkout commits
Failure/Error: expect(repo.checkout(first_commit.hash)).to be_success("HEAD is now at #{first_commit.hash}.", first_commit)
TypeError:
no implicit conversion of String into Integer
# /tmp/d20160111-5693-7h360d/spec.rb:223:in `hash'
# /tmp/d20160111-5693-7h360d/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)>'
27) ObjectStore cannot checkout commits with nonexisting hashes
Failure/Error: expect(repo.checkout("[not-present]")).to be_error("Commit [not-present] does not exist.")
expected #<Response:0x007fdc93b3caa0 @message="Commit -4535787171697950093 does not exist.", @result=nil> to be error "Commit [not-present] does not exist."
# /tmp/d20160111-5693-7h360d/spec.rb:231: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)>'
28) ObjectStore cannot checkout commits in empty repository
Failure/Error: expect(repo.checkout("[not-present]")).to be_error("Commit [not-present] does not exist.")
expected #<Response:0x007fdc93b345d0 @message="Commit 603881904901999047 does not exist.", @result=nil> to be error "Commit [not-present] does not exist."
# /tmp/d20160111-5693-7h360d/spec.rb:236: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)>'
29) ObjectStore can show the objects in a repo after overwriting an object
Failure/Error: expect(first_commit.objects).to match_array(["content1"])
NoMethodError:
undefined method `objects' for #<Array:0x007fdc93b23bb8>
# /tmp/d20160111-5693-7h360d/spec.rb:243: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)>'
30) ObjectStore can show the objects of a repo after removing an object
Failure/Error: expect(first_commit.objects).to match_array(["content1", "content2", "content3"])
NoMethodError:
undefined method `objects' for #<Array:0x007fdc93b21160>
# /tmp/d20160111-5693-7h360d/spec.rb:259: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.02705 seconds
30 examples, 30 failures
Failed examples:
rspec /tmp/d20160111-5693-7h360d/spec.rb:21 # ObjectStore can add objects
rspec /tmp/d20160111-5693-7h360d/spec.rb:26 # ObjectStore can commit objects
rspec /tmp/d20160111-5693-7h360d/spec.rb:33 # ObjectStore cannot commit without changed objects
rspec /tmp/d20160111-5693-7h360d/spec.rb:38 # ObjectStore can remove objects
rspec /tmp/d20160111-5693-7h360d/spec.rb:46 # ObjectStore can commit changes which include only removed objects
rspec /tmp/d20160111-5693-7h360d/spec.rb:56 # ObjectStore cannot remove objects that are not committed
rspec /tmp/d20160111-5693-7h360d/spec.rb:63 # ObjectStore can show head
rspec /tmp/d20160111-5693-7h360d/spec.rb:72 # ObjectStore cannot show head for empty repository
rspec /tmp/d20160111-5693-7h360d/spec.rb:77 # ObjectStore can show log of changes for a single commit
rspec /tmp/d20160111-5693-7h360d/spec.rb:86 # ObjectStore can show log of changes for a single commit
rspec /tmp/d20160111-5693-7h360d/spec.rb:95 # ObjectStore can show log of changes for multiple commits
rspec /tmp/d20160111-5693-7h360d/spec.rb:111 # ObjectStore shows the log for the current branch only
rspec /tmp/d20160111-5693-7h360d/spec.rb:131 # ObjectStore cannot show log for empty repository
rspec /tmp/d20160111-5693-7h360d/spec.rb:136 # ObjectStore can list branches
rspec /tmp/d20160111-5693-7h360d/spec.rb:143 # ObjectStore can create branches
rspec /tmp/d20160111-5693-7h360d/spec.rb:148 # ObjectStore cannot create branch if already exists
rspec /tmp/d20160111-5693-7h360d/spec.rb:153 # ObjectStore can switch branches
rspec /tmp/d20160111-5693-7h360d/spec.rb:166 # ObjectStore cannot switch to nonexisting branch
rspec /tmp/d20160111-5693-7h360d/spec.rb:171 # ObjectStore can remove branch
rspec /tmp/d20160111-5693-7h360d/spec.rb:177 # ObjectStore cannot remove current branch
rspec /tmp/d20160111-5693-7h360d/spec.rb:182 # ObjectStore cannot remove nonexisting branch
rspec /tmp/d20160111-5693-7h360d/spec.rb:187 # ObjectStore can be initialized with block
rspec /tmp/d20160111-5693-7h360d/spec.rb:198 # ObjectStore can return objects
rspec /tmp/d20160111-5693-7h360d/spec.rb:205 # ObjectStore cannot return not committed objects
rspec /tmp/d20160111-5693-7h360d/spec.rb:212 # ObjectStore cannot return objects when no commits
rspec /tmp/d20160111-5693-7h360d/spec.rb:217 # ObjectStore can checkout commits
rspec /tmp/d20160111-5693-7h360d/spec.rb:227 # ObjectStore cannot checkout commits with nonexisting hashes
rspec /tmp/d20160111-5693-7h360d/spec.rb:234 # ObjectStore cannot checkout commits in empty repository
rspec /tmp/d20160111-5693-7h360d/spec.rb:239 # ObjectStore can show the objects in a repo after overwriting an object
rspec /tmp/d20160111-5693-7h360d/spec.rb:253 # ObjectStore can show the objects of a repo after removing an object
История (2 версии и 0 коментара)
Мирослав обнови решението на 23.11.2015 13:53 (преди около 9 години)
Мирослав обнови решението на 23.11.2015 15:29 (преди около 9 години)