
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
Shoulda helps you write more understandable, maintainable Rails-specific tests under Minitest and Test::Unit.
📢 See what's changed in recent versions.
As an umbrella gem, the shoulda
gem doesn't contain any code of its own but
rather brings in behavior from two other gems:
For instance:
require "test_helper"
class UserTest < ActiveSupport::TestCase
context "associations" do
should have_many(:posts)
end
context "validations" do
should validate_presence_of(:email)
should allow_value("user@example.com").for(:email)
should_not allow_value("not-an-email").for(:email)
end
context "#name" do
should "consist of first and last name" do
user = User.new(first_name: "John", last_name: "Smith")
assert_equal "John Smith", user.name
end
end
end
Here, the context
and should
methods come from Shoulda Context; matchers
(e.g. have_many
, allow_value
) come from Shoulda Matchers.
See the READMEs for these projects for more information.
Shoulda is tested and supported against Ruby 3.0+, Rails 6.1+, RSpec 3.x, Minitest 4.x, and Test::Unit 3.x.
Shoulda follows Semantic Versioning 2.0 as defined at http://semver.org.
Shoulda is maintained by Elliot Winkler. It was previously maintained by Travis Jeffery.
Shoulda is copyright © 2006-2023 Tammer Saleh and thoughtbot, inc. It is free and opensource software and may be redistributed under the terms specified in the LICENSE file.
The names and logos for thoughtbot are trademarks of thoughtbot, inc.
We are passionate about open source software. See our other projects. We are available for hire.
FAQs
Unknown package
We found that shoulda demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers 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
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.