-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kintsugi: Add integration tests. #66
Conversation
byohay
commented
May 30, 2022
- kintsugi.gemspec: Add git as development dependency.
- Add integration tests.
3f50c2c
to
c5eed4d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, you can rename lib/kintsugi/kintsugi.rb
to lib/kintsugi/resolve.rb
or similar.
kintsugi.gemspec
Outdated
@@ -28,5 +28,7 @@ Gem::Specification.new do |spec| | |||
spec.add_development_dependency "rspec", "~> 3.9" | |||
spec.add_development_dependency "rubocop", "1.12.0" | |||
spec.add_development_dependency "rubocop-rspec", "2.2.0" | |||
spec.add_development_dependency "rubocop-performance", "1.13.3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
spec/kintsugi_spec.rb
Outdated
Kintsugi::run([File.join(project.path, "project.pbxproj")]) | ||
|
||
project = Xcodeproj::Project.open(project_path) | ||
expect(project.targets.count).to equal(2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expect(project.targets.count).to equal(2) | |
expect(project.targets.map(&:display_name)).to contain_exactly("foo", "bar") |
spec/kintsugi_spec.rb
Outdated
|
||
# Changes are supposed to be in `ours_project` after driver is called. | ||
ours_project = Xcodeproj::Project.open(ours_project.path) | ||
expect(Xcodeproj::Project.open(ours_project.path).targets.count).to equal(2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expect(Xcodeproj::Project.open(ours_project.path).targets.count).to equal(2) | |
expect(ours_project.targets.map(&:display_name)).to contain_exactly("foo", "bar") |
spec/kintsugi_spec.rb
Outdated
ours_project = Xcodeproj::Project.open(ours_project.path) | ||
expect(Xcodeproj::Project.open(ours_project.path).targets.count).to equal(2) | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add tests for errors - make sure the state of the folder in the end is what it should be.
If you can, also add tests for the driver
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a test that checks that after Kintsugi failed to resolve a conflict the project wasn't touched and is still has conflicts.
lib/kintsugi.rb
Outdated
@@ -1,167 +1,49 @@ | |||
# Copyright (c) 2021 Lightricks. All rights reserved. | |||
# Created by Ben Yohay. | |||
#!/usr/bin/env ruby |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this shouldn't be here
2d97b16
to
c026462
Compare
@ashdnazg round done. |
d3aa28f
to
4c29371
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment.
The rest is really great!
spec/kintsugi_integration_spec.rb
Outdated
Kintsugi.run([File.join(project.path, "project.pbxproj")]) | ||
}.to raise_error(Kintsugi::MergeError) | ||
expect { | ||
project = Xcodeproj::Project.open(project.path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this the best way to check if conflicts are kept?
Maybe just diff the file with the previous version?
4c29371
to
b5b30e7
Compare