Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
= Spork {}[https://travis-ci.org/sporkrb/spork]
== SYNOPSIS:
Spork is Tim Harper's implementation of test server (similar to the script/spec_server that used to be provided by rspec-rails), except rather than using the Rails constant unloading to reload your files, it forks a copy of the server each time you run your tests. The result? Spork runs more solid: it doesn't get corrupted over time, it can work with any ruby framework, and it properly handles modules and any voodoo meta programming you may have put in your app.
Spork runs on POSIX systems using fork. It also runs on windows by pre-populating a pool of ready processes (referred to here as the "magazine" strategy).
== Supported Testing Frameworks
== Supported Application Frameworks
Spork can work with any application framework, but needs work to prevent application files from being eager loaded.
See https://github.com/sporkrb/spork/wiki/Supported-Application-Frameworks for a list of supported frameworks and their gems.
== INSTALL:
NOTICE:
Rails support (and other app frameworks) have been extracted. If using spork with rails, you'll want to use spork-rails gem, https://github.com/sporkrb/spork-rails.
If you wish to use the stable verson of spork 0.9, refer to https://github.com/sporkrb/spork/tree/v0.9.x
=== Bundler:
Add to your Gemfile:
gem 'spork', '~> 1.0rc'
== Usage
From a terminal, change to your project directory.
Then, bootstrap your test helper file. If running rspec,
spork rspec --bootstrap
Cucumber:
spork cucumber --bootstrap
TestUnit:
(Install the spork-testunit gem) spork test_unit --bootstrap
(If you don't specifiy a test framework, spork will find one and pick it.)
Follow the instructions.
Finally, run spork. A spec DRb server will be running!
spork
== Diagnostic mode
Initially, you may find that a few files don't reload automatically. This is because they are being loaded during Spork startup. To identify which project files are being pre-loaded, and why, run:
spork --diagnose | less (or spork -d, for short)
It will output a lot of stuff. At the top you'll find a summary of all project files loaded. Down below, the stack trace for each file (how it got loaded). Spork hooks into Rails and does some magic (TM) to prevent ApplicationController observers, etc from pre-loading. Similar hooks for other ruby frameworks may come as support demands.
Some project changes will require a spork restart, and you shouldn't expect them to not (IE: modifying your project gem dependencies or core application config). Any file that is loaded during Spork start-up will be cached until Spork is restarted. You can restart spork by sending a USR2 signal to the server process. This could be automated with a gem such as Kicker (https://github.com/alloy/kicker). Since a native hook is required for each operating system to efficiently watch for filesystem changes, automatic restarting has not been built into Spork.
You may find this wiki page useful for common ways to battle a variety of common pre-loading issues: http://github.com/sporkrb/spork/wiki/Spork.trap_method-Jujutsu
== Running specs over Spork
=== RSpec
To get the TextMate RSpec bundle to use spork, go to config->advanced->shell variables, and add:
TM_RSPEC_OPTS=--drb.
To run from the command line, use:
rspec --drb spec/lib/my_spec.rb
Or, you could add the following flag to your +spec.opts+ (or +.rspec+ depending on your version of rspec) file.
--drb
=== Cucumber
Cucumber has DRb support (see http://wiki.github.com/cucumber/cucumber/spork-and---drb)
cucumber --drb features/my.feature
Use this as a guideline when "Sporking" your features/support/env.rb file
== Running the Spork test suite
If you wish to hack on spork, you will want to run the automated test suite to make sure your changes don't break anything. Spork uses bundler to manage and install dependencies. To start:
bundle install
Then, to run the specs:
bundle exec rspec spec/
(or, alternatively...)
bundle exec rake
=== running features ===
Essentially:
bundle exec cucumber features
== Some potential issues and ways to overcome them:
See http://wiki.github.com/sporkrb/spork/troubleshooting
== Kudos to
Spork (c) 2012 Tim Harper, released under the MIT license
FAQs
Unknown package
We found that spork 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.