https://github.com/helpscout/jekyll-joule
Joule 🔸: A Jekyll library for Unit Testing
https://github.com/helpscout/jekyll-joule
jekyll open-source unit-testing
Last synced: 3 months ago
JSON representation
Joule 🔸: A Jekyll library for Unit Testing
- Host: GitHub
- URL: https://github.com/helpscout/jekyll-joule
- Owner: helpscout
- License: mit
- Created: 2017-06-02T21:33:59.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-07-20T14:45:20.000Z (almost 8 years ago)
- Last Synced: 2025-03-12T20:43:05.480Z (3 months ago)
- Topics: jekyll, open-source, unit-testing
- Language: Ruby
- Homepage:
- Size: 36.1 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Joule 🔸 [](https://travis-ci.org/helpscout/jekyll-joule) [](https://badge.fury.io/rb/jekyll-joule) [](https://coveralls.io/github/helpscout/jekyll-joule?branch=master)
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](https://github.com/seattlerb/minitest). However, you **should** be able to use it with other testing frameworks.
## Install
Add this line to your application's Gemfile:
```ruby
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.
```rb
class ExampleTest < JekyllUnitTest
should "render a div containing the Page title" do
@joule.render(%Q[
---
title: "Yiss"
---
{{ page.title }}
])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](./docs/rendering.md)
## Documentation
**[View the docs](https://github.com/helpscout/jekyll-joule/blob/master/docs/introduction.md)** to get started with Joule!
## Examples
**[View the example](https://github.com/helpscout/jekyll-joule/tree/master/examples)** Jekyll setup + Joule test files.