Petitest::Spec
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/dsl"
class ExampleTest < Petitest::Test
include ::Petitest::Spec
# ... your tests ...
end
.describe and .context
Nest a test group with description. .context
is an alias.
describe do "GET /me"
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