
Security News
Nx npm Packages Compromised in Supply Chain Attack Weaponizing AI CLI Tools
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
The tiniest unit tester, ported to Ruby
require_relative 'cake'
TestRunner.new('Test Runner - Basic', [
Group.new('Group Basic', [
Test.new(
'True should be true',
action: ->(test) {
value = 'foo'
test.actual = value
test.expected = value
},
assertions: ->(test) { [Expect::Equals.new(actual: test.actual, expected: test.expected)] }
)
])
])
You can also pass variables from parents and test stages.
Group.new('Groups can assign context', [
Test.new(
'Group can pass context to children',
assertions: ->(test) { [Expect::Equals.new(actual: test.foo, expected: 'bar')] }
),
Test.new(
'Children can override parent context',
action: ->(test) { test.foo = 'baz' },
assertions: ->(test) { [Expect::Equals.new(actual: test.foo, expected: 'baz')] }
)
], setup: ->(test) {
test.foo = 'bar'
}),
gem install cake-tester
cake-tester
in the directory that you want to run your tests in. It will search any files in the directory or any sub-folders ending with cake.rb
.-f [fileName]
cake-tester -f foo
will test 'test-foo.cake.rb'-v
or --verbose
-t [testFilter]
, --tt [testFilter]
, --tte [testName]
, --tg [groupFilter]
, --tge [groupName]
, --tr [testRunnerFilter]
, --tre [testRunnerName]
-t
General search: ruby cake-tester -t foo
- Run all tests, groups, and runners with "foo" in the title--tt
Test search ruby cake-tester --tt "cool test"
- Run all tests with the phrase "cool test" in the title--tte
Test search, exact: ruby cake-tester --tte "should only run when this one specific thing happens"
- Runs only the test that matches the phrase exactly.--tg
Group search ruby cake-tester --tg bar
- Run all groups matching "bar" in the title--tge
Group search, exact: `ruby cake-tester --tge "API Endpoints" - Runs all groups exactly matching the phrase "API Endpoints"--tr
Test Runner search: `ruby cake-tester --tr "Models" - Runs all test runners with "Models" in the title--tre
Test Runner search, exact: ruby cake-tester --tre "Models - User"
- Runs test runners that exactly match the phrase "Models - User"-i
FAQs
Unknown package
We found that cake-tester demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.