
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
standard_assert
is a Standard Library-like library for assertions in Ruby.
It is aimed at encouraging us to use assertion methods anywhere; Not only testing but also production.
Add this line to your application's Gemfile:
gem 'standard_assert'
And then execute:
$ bundle
Since assertion methods are defined as module functions of Assert
, you can use them as instance methods
to any classes that mix in the module:
require 'standard_assert'
class Stack
include ::Assert
def initialize
@store = []
end
def pop
assert(!@store.empty?)
@store.pop
end
def push(element)
@store.push(element)
self
end
end
Stack.new.pop #=> AssertionError (Expected false to be truthy.)
Or just call them with the module as a receiver:
class Stack
def peek
::Assert.assert(!@store.empty?)
@store.last
end
end
Stack.new.peek #=> AssertionError (Expected false to be truthy.)
Note that Assert
provides aseert
and assert_*
methods same as in Minitest::Assertions
except they throw not Minitest::Assertion
but AssertionError
when an assertion fails.
See also: http://docs.seattlerb.org/minitest/Minitest/Assertions.html
You should follow the steps below.
git checkout -b add-new-feature
git commit -am 'Add new feature'
git push origin add-new-feature
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that standard_assert demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.