Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
minitest-assert_changes
Advanced tools
Introduces assert_changes
and assert_no_changes
to Minitest
.
Add this line to your application's Gemfile:
gem 'minitest-assert_changes'
And then execute:
$ bundle
assert_changes
is a more general assert_difference
that works with any
value.
assert_changes 'Error.current', from: nil, to: 'ERR' do
expected_bad_operation
end
Can be called with strings, to be evaluated in the binding (context) of the block given to the assertion, or a lambda.
assert_changes -> { Error.current }, from: nil, to: 'ERR' do
expected_bad_operation
end
The from
and to
arguments are compared with the case operator (===
).
assert_changes 'Error.current', from: nil, to: Error do
expected_bad_operation
end
This is pretty useful, if you need to loosely compare a value. For example, you need to test a token has been generated and it has that many random characters.
user = User.start_registration
assert_changes 'user.token', to: /\w{32}/ do
user.finish_registration
end
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that minitest-assert_changes 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.