-
Notifications
You must be signed in to change notification settings - Fork 33
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
Add tests for INIParser.create_linux_ini' #89
Conversation
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.
Small changes have to be considered, but it looks fine otherwise
spec/u3d/iniparser_spec.rb
Outdated
@@ -82,5 +82,36 @@ | |||
end | |||
end | |||
end | |||
|
|||
describe '.create_linux_ini', focuss: true do |
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.
Remove focus tag if this is not meant to stay?
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.
Sure. I forgot it.
spec/u3d/iniparser_spec.rb
Outdated
it 'does not rewrite the file' do | ||
path = %r{\/.u3d\/ini_files\/unity-1.2.3f4-linux.ini} | ||
|
||
allow(U3dCore::Helper).to receive(:operating_system) { :linux } |
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.
You can use shortcut on_linux
from the setups
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.
👍
spec/u3d/iniparser_spec.rb
Outdated
|
||
allow(File).to receive(:file?).with(path) { false } | ||
file = double('file') | ||
allow(File).to receive(:open).with(path, 'wb') { |&block| block.call(file) } |
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.
.and_yield file
may be more elegant? It would be more consistent with the rest of the test as well
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.
Ah yes. I was looking for the right way to do that
No description provided.