Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

petitest-assertions

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

petitest-assertions

  • 0.2.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Petitest::Assertions

Gem Version Documentation

Assertions for Petitest.

Installation

Add this line to your application's Gemfile:

gem "petitest-assertions"

And then execute:

bundle

Or install it yourself as:

gem install petitest-assertions

Usage

Setup

  1. Require "petitest/assertions"
  2. Include Petitest::Assertions into your test groups
require "petitest/autorun"
require "petitest/assertions"

class ExampleTest < Petitest::TestGroup
  include ::Petitest::Assertions

  # ... test cases ...
end

assert_equal

assert_equal(2, 1 + 1)

assert_match

assert_match(/foo/, "fooooo")

assert_operator

assert_operator(2, :>, 1)

assert_output

assert_output(/foo/, nil) do
  puts "fooooo"
end

assert_output

assert_output(nil, /foo/) do
  $stdout.puts "fooooo"
end

assert_output

assert_output(/foo/, /bar/) do
  puts "fooooo"
  $stdout.puts "barrrr"
end

assert_raise

assert_raise(::StandardError) do
  raise
end

assert_to_be

assert_to_be(:empty, [])

assert_to_have

assert_to_have(:key, :foo, foo: :bar)

FAQs

Package last updated on 23 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc