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

Application tests #688

Merged
merged 4 commits into from
Aug 14, 2021
Merged

Application tests #688

merged 4 commits into from
Aug 14, 2021

Conversation

lovro-bikic
Copy link
Member

Adds tests for application class, mainly what happens when you set a command-line option.

@lovro-bikic lovro-bikic added this to the 1.3.0 milestone Aug 14, 2021
Comment on lines +14 to +19
# :nocov:
def run
Rake.application = self
super
end
# :nocov:
Copy link
Member Author

Choose a reason for hiding this comment

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

I removed this method from simplecov coverage because there's no easy way to test this without invoking a task.

@top_level_tasks << :debug_configuration_variables
@top_level_tasks << :run_commands

@top_level_tasks << 'debug_configuration_variables'
Copy link
Member Author

Choose a reason for hiding this comment

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

All @top_level_tasks are strings so I modified the default task names. It worked before because Rake calls to_s on a task name (ref)

@@ -38,48 +41,53 @@ def minafile
end

def version
['--version', '-V',
Copy link
Member Author

Choose a reason for hiding this comment

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

The below code doesn't touch the logic, only style.

@lovro-bikic lovro-bikic merged commit dbe9ccd into master Aug 14, 2021
@lovro-bikic lovro-bikic deleted the feature/application-tests branch August 14, 2021 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants