0.0
No commit activity in last 3 years
No release in over 3 years
BDD style DSL for Petitest.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.14
~> 10.0

Runtime

~> 0.3.1
~> 0.3.0
 Project Readme

Petitest::Spec

Gem Version Documentation

BDD style DSL for Petitest.

Installation

Add this line to your application's Gemfile:

gem "petitest"

And then execute:

bundle

Or install it yourself as:

gem install petitest

Usage

Require "petitest/spec" and extend Petitest::Spec into your test class.

require "petitest/autorun"
require "petitest/spec"

class ExampleTest < Petitest::Test
  include ::Petitest::Spec

  # ... your tests ...
end

.describe and .context

Nest a test group with description. .context is an alias.

describe "GET /me" do
  context "without logged-in" do
    it "returns 401" do
      assert { response.status == 200 }
    end
  end
end

.it and .specify

Define a test with description. .specify is an alias.

it "returns foo" do
  assert { x == "foo" }
end

specify "x is foo" do
  assert { x == "foo" }
end

.let

Define a memozied method.

let(:result) do
  1 + 1
end

it "returns 2" do
  assert { result == 2 }
end