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

Redo Testing framework #109

Open
zbintliff opened this issue Jan 19, 2016 · 3 comments
Open

Redo Testing framework #109

zbintliff opened this issue Jan 19, 2016 · 3 comments

Comments

@zbintliff
Copy link
Contributor

Instead of just testing IO and sub-process as the plugin currently does.

Should we use spec (or minitest) to test the base classes? Here is an example test document for a check. And here is an example test cases for a handler/mutator.

@zbintliff
Copy link
Contributor Author

There is an issue with the above linked spec for the check in taht it always exits 0. But after #116 is merged then we can use the format in the second example (set autorun to false)

@cwjohnston
Copy link
Contributor

@zbintliff any ideas about how we move forward on this?

@zbintliff
Copy link
Contributor Author

zbintliff commented Jul 21, 2016

So threw this together super fast so its definitely lacking. But take a look at this. I converted everything to rspec and wrote 2 test basic test cases for sensu-handler and sensu-plugin.

I chose rspec because it seems that what all the actual plugins are using. I can keep working on this when I get some free time this week to build a better example.

But basically every file will have an accompanying _spec.rb and that will test only the functions within that file. That way we have more insight into the plugins other than input and output. If this is what you're interested in I will be happy to help.

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

No branches or pull requests

2 participants