Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Cover Kaiserfile class with tests #39

Merged
merged 4 commits into from
Feb 20, 2020
Merged

Cover Kaiserfile class with tests #39

merged 4 commits into from
Feb 20, 2020

Conversation

davidsiaw
Copy link
Collaborator

@davidsiaw davidsiaw commented Jan 15, 2020

Ref #24
Ref #25

This PR adds tests for the Kaiserfile class, as an ongoing effort to start increasing Kaiser's test coverage. With this we will be able to modify the Kaiserfile syntax with more confidence, and it will double as documentation.

How to test

  1. Run rspec and see Kaiserfile tests

@davidsiaw davidsiaw force-pushed the test-kaiserfile branch 2 times, most recently from bf26b5a to 3f97f1e Compare January 15, 2020 09:54
@degicat
Copy link

degicat commented Feb 12, 2020

@Resonious please review this

Copy link
Member

@Resonious Resonious left a comment

Choose a reason for hiding this comment

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

More tests is great. Not much to complain about there. A couple of tiny questions, then it looks good to me.

Comment on lines 44 to 48
begin
Aruba::RSpec.teardown
rescue StandardError => e
puts e
end
Copy link
Member

Choose a reason for hiding this comment

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

What's the begin/rescue for? Seems to work for me without. And I imagine if this were to error, the puts e might be a bit confusing if you don't know what it's coming from.

Comment on lines 66 to 68
expect(kaiserfile.database[:image]).to eq 'somedb:version'
expect(kaiserfile.database[:data_dir]).to eq '/var/lib/dbdb'
expect(kaiserfile.database[:port]).to eq 1414
Copy link
Member

Choose a reason for hiding this comment

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

Do you think this spec should only test kaiserfile.database[:commands]? The other attributes are already tested for in the above spec. Right now if any of those other attributes don't work, it'll make every spec fail for the same reason, even if :commands still works.

(Same applies to the below specs)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I guess you are right I'll try and slim this down

@davidsiaw
Copy link
Collaborator Author

@Resonious sorry it took so long but could you have a look at this again? I removed the less useful expects from the tests.

Copy link
Member

@Resonious Resonious left a comment

Choose a reason for hiding this comment

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

Alright LGTM 👍

@Resonious Resonious merged commit e4f18bd into master Feb 20, 2020
@davidsiaw davidsiaw deleted the test-kaiserfile branch February 20, 2020 06:54
@degikko degikko restored the test-kaiserfile branch March 30, 2020 03:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants