
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Lightweight test runner, primarily written to support development of Righteous Git Hooks.
Written in Ruby, designed to test command line apps, whether they're written in Ruby, Shell, Bash, C#, Java, whatever ;)
Tests are written in Command Unit itself, so no need for any external dependencies yet. I might make this a fundamental requirement of future development, but I'll see how far the project can go on basic Ruby first.
So far I've only tested this on Ruby 1.9.3, others may work but I'm not considering support on any other platforms until I've got a stable/useful release out. The code itself is very rough-and ready, and could benefit from quite a lot of refactoring, especially in scenario.rb.
require 'command-unit'
include CommandUnit
scenario 'Writing tests in Command Unit' do
when_i 'do something wacky' do |context|
context[:data] = 'call a method or something here'
end
i_expect "to receive a string containing 'or' do |context|
expect context[:data], &contains('or')
end
i_expect "the string to exactly equal 'or'" do |context|
expect context[:data], &is_equal_to('or')
end
end
run
Output:
Running 1 scenarios...
Running scenario 1: Writing tests in Command Unit
When I do something wacky
I expect to receive a string containing 'or'...Success!
I expect the string to exactly equal 'or'...Failure!
Expecting exactly 'or', but got 'call a method or something here'
Scenario 1 finished, 1 tests, 2 expectations with 1 successful and 1 failures.
Ran 1 scenarios, 0 passed, 1 failed (tests passed: 0, failed: 1) (expectations passed: 1, failed: 1)
gem install command-unit
Unpack the gem with gem unpack command-unit
Run tests:
$ cd command-unit-0.0.3
$ ruby test/test.rb
This is fairly experimental, and I know a lot of people probably won't like it, or will think it needless (why not just use rspec?!), but it satisfies a need I have right now, and I'm happy so far.
I'd really love to hear any constructive criticism on both the code and the conventions in test-writing that command-unit enforces, you can email me at samsalisbury@gmail.com
FAQs
Unknown package
We found that command-unit 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
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.