Open Ecco opened 4 years ago
Capybara is nice! I’ve been using it on other projects as well.
Would you be interested in adding such a feature within Nanoc directly?
I think this would be too far away from Nanoc’s purpose to include within Nanoc itself.
Arguably, even the checks functionality as a whole shouldn’t be part of Nanoc, but rather something independent that Nanoc can easily integrate with. The same goes for the deploy functionality.
I’ll move this issue to the features
repository so that the discussion isn’t lost.
I've needed to run some rather complex tests on a Nanoc website (involving lots of JS), and the best solution was to use Capybara. It's actually quite nice, and there are just a few gotchas to take care of.
Here's a small gist of the code I wrote:
And then using it is rather straightforward:
Question
Would you be interested in adding such a feature within Nanoc directly?
Notes
require "capybara"
when executing theinitialize
method. That's kind of weird, but otherwise Capybara would always be loaded alongside nanoc. But I really don't want/need Capybara to be loaded when simply building the site. Anyway, this trick works, but that was painful to write. Maybe checks should live in a separate directory (not/lib
) and only be loaded when running them?