Skip to content
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

Merged
merged 2 commits into from
Aug 27, 2017

Conversation

lacostej
Copy link
Member

No description provided.

@lacostej lacostej assigned lacostej and unassigned lacostej Aug 27, 2017
@lacostej lacostej requested a review from niezbop August 27, 2017 06:42
Copy link
Member

@niezbop niezbop left a 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

@@ -82,5 +82,36 @@
end
end
end

describe '.create_linux_ini', focuss: true do
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I forgot it.

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 }
Copy link
Member

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


allow(File).to receive(:file?).with(path) { false }
file = double('file')
allow(File).to receive(:open).with(path, 'wb') { |&block| block.call(file) }
Copy link
Member

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

Copy link
Member Author

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

@lacostej lacostej merged commit b6f8028 into DragonBox:master Aug 27, 2017
@lacostej lacostej deleted the iniparser_tests branch August 27, 2017 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants