rubycritic
rubycritic copied to clipboard
Add basic test for HTML report generation
This is a naive copy-and-adapt of the existing json_report_test.rb
; I created it to see if I could work up a test for #372, but I think I'm going to have to concede defeat on that - there's too much mocking going on that I don't understand properly - but I thought this file might at least be a starting point for somebody else to use as a base for adding that test in the future?
Let me know if this looks useful, and if so I'll squash it and do the CHANGELOG thing - probably after you do your imminent release.
Seems to be failing on Ruby 2.5 and 2.6 (but not 2.4, wut??) on Travis CI - again, at first glance I don't think I know what's going on there, sorry.
Least useful PR ever 😄
Oh, except... I just ran the test suite under 2.7.2 on my machine and it failed with the same error the other two have on Travis. Then I blew away all the things that are ignored in the .gitignore - tmp, the output in test/samples, etc etc - and the tests ran successfully.
Then I switched to 2.6.6 and the tests ran okay without clearing temp files again (?!)
Then 2.5.8, where they had the same error, which again cleared when I cleared the temp files.
I still have no idea what's going on, but maybe somebody else can guess based on that lot.
In vaguely related news, the tests fail early for me on Ruby 3.0.0, with "File does not exist: rexml/document"
Presumably related to this in 3.0.0 release notes:
The following default gems are now bundled gems.
- rexml
I'm not sure what adding it to the Gemfile would do to older Rubies, so I haven't.
Thanks for this investigation @denny I'll have a better look towards the weekend. Regarding ruby3, we should add that to the travis config, and allow failures for now. Then create issues to address those failures and prepare a release that supports ruby3. :)
Continuing this work over here: https://github.com/whitesmith/rubycritic/pull/483