Joule 🔸: A Jekyll library for Unit Testing
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
examples
lib
test
.gitignore
.travis.yml
Gemfile
LICENSE.txt
README.md
Rakefile
jekyll-joule.gemspec

README.md

Joule 🔸 Build Status Gem Version Coverage Status

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.