
Security News
Researcher Exposes Zero-Day Clickjacking Vulnerabilities in Major Password Managers
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
Nodule is really new software (all of 2 weeks old). It was extracted from a larger project where it is used for some really large integration tests. We'll remove this message once Nodule has a reasonable set of tests of its own.
Nodule is an integration test harness that simplifies the setup and teardown of multi-process or large multi-component applications.
When setting up complex tests with multiple processes, a lot of work ends up going into generating configuration, command-line parameters, and other fiddly things that are their own sources of annoying bugs. Nodule tries to tidy some of that up by providing a way to define a test topology that automatically injects data in the right places lazily so it doesn't all have to be done up-front.
In as many places as possible, Nodule allows you to use a symbol as a placeholder for a value, which it will automatically resolve when it's needed and no earlier, so you aren't forced to worry about ordering.
Saying ":file => Nodule::Tempfile.new" means that :file will resolve to a temporary file's path (via .to_s) in any place it appears as a placeholder. :file can be used before it's associated with a tempfile.
In many places, procs can be used as placeholders and will be automatically called when needed.
The process module requires commands to be specified as argv-style arrays. The array is scanned for placeholders, which are converted as already described. The one addition is sub-arrays, which are resolved and concatenated without padding. This is useful for parameters that use '=' without spaces, for example, "dd if=" would be specified as ['dd', ['if=', :file]]. These sub-arrays are resolved recursively, so multiple levels are allowed.
#!/usr/bin/env ruby
require "test/unit"
require 'nodule/process'
require 'nodule/topology'
require 'nodule/tempfile'
require 'nodule/console'
class NoduleSimpleTest < Test::Unit::TestCase
def setup
@topo = Nodule::Topology.new(
:greenio => Nodule::Console.new(:fg => :green),
:redio => Nodule::Console.new(:fg => :red),
:file1 => Nodule::Tempfile.new(".html"),
:wget => Nodule::Process.new(
'/usr/bin/wget', '-O', :file1, 'http://www.ooyala.com',
:stdout => :greenio, :stderr => :redio
)
)
@topo.run_serially
end
def teardown
@topo.cleanup
end
def test_heartbeat
filename = @topo[:file1].to_s
assert File.exists? filename
end
end
Nodule is released under the MIT license.
FAQs
Unknown package
We found that nodule demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.