Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cucumber_rake_runner

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cucumber_rake_runner

  • 0.0.3
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

CucumberRakeRunner

Cucumber helper to run rake tasks in the current process, capturing properties to assert tests against

Installation

Step 1

Add this line to your application's Gemfile:

gem 'cucumber_rake_runner', require: false

And then execute:

$ bundle

Or install it yourself as:

$ gem install cucumber_rake_runner

Step 2

Add the following line to your cucumber environment file typically found at features\support\env.rb

require 'cucumber_rake_runner'

Problem

Sometimes there is a need to test your rake tasks. Typically this is done by a system call such as

@output = `rake some:amazing:task`

Sometimes this is desirable, at other times, in particular when using Jruby it is not. For each execution of the above a new JVM must spin up costing significant delays to test turnaround time.

The solution is to run the task inline to the cucumber process via Rake's invoke command. This gem provides a handy dandy solution to get the above functionality and more while running the rake task inline to the current process.

Usage

Simply incorportate the following call appropriately in your step definitions

@rake_output = run_rake_task(task_name, arg1, arg2, ... )

This will run the rake tasks with the specified parameters. If the rake task does not take parameters only the task_name is required.

The returned obect from this call is an OpenStruct with the following properties

  1. stdout - All output generated by the task sent to stdout
  2. stderr - All output generated by the task sent to stderr
  3. time - Time taken to execute rake task.

for example

@rake_output.stdout.include? 'Some expected output from task'

See the features and step definitions in this gem for example usage.

Contributing

Tests can be run via

cucumber

There are rake task definitions that the tests depend on. Please feel free to expand.

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

FAQs

Package last updated on 28 Sep 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc