No commit activity in last 3 years
No release in over 3 years
It is option command builder of 'rspec' for RSpec::Core::RakeTask#rspec_opts
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 10.0

Runtime

 Project Readme

Rspec::CommandOption

It is option command builder of 'rspec' for RSpec::Core::RakeTask#rspec_opts

Installation

Add this line to your application's Gemfile:

gem 'rspec-command_option'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rspec-command_option

Usage

The simplest examples

require 'rspec/command_option'

option_example1 = RSpec::CommandOption.new do |opt|
  opt.dry_run = true
  opt.color = true
  opt.tag = "~speed:slow"
end

puts option_example1.build #=> '--dry-run --color --tag=\~speed:slow'
require 'rspec/command_option'

option_example2 = RSpec::CommandOption.new
option_example2.dry_run = true
option_example2.format = 'documentation'

puts option_example2.build #=> '--dry-run --format=documentation'

With RSpec::Core::RakeTask

require 'rspec/core/rake_task'
require 'rspec/command_option'

rspec_opt = RSpec::CommandOption.new do |opt|
  opt.dry_run = true
  opt.color = true
  opt.tag = "~speed:slow"
end

# If you execute this rake command, will execute 'rspec' command with '--dry-run --color --tag=\~speed:slow'
desc "Run examples"
RSpec::Core::RakeTask.new(:spec) do |t|
  t.rspec_opts = rspec_opts
end

Contributing

  1. Fork it ( https://github.com/[my-github-username]/rspec-command_option/fork )
  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 a new Pull Request