Joule 🔸
Joule is a Jekyll utility helper designed to make it (way) easier to write unit tests.
So far, Joule has only been tested with minitest. However, you should be able to use it with other testing frameworks.
Install
Add this line to your application's Gemfile:
gem 'jekyll-joule'
And then execute:
bundle
Or install it yourself as:
gem install jekyll-joule
Basic Usage
Below is an example of how you can write a test with Joule.
class ExampleTest < JekyllUnitTest
should "render a div containing the Page title" do
@joule.render(%Q[
---
title: "Yiss"
---
<div class="aww">
{{ page.title }}
</div>
])
el = @joule.find(".aww")
assert(el)
assert(el.text.include?("Yiss"))
assert(el["class"].include?("aww"))
end
end
Check out the full rendering API documentation
Documentation
View the docs to get started with Joule!
Examples
View the example Jekyll setup + Joule test files.