davetron5000 / optparse-plus

Start your command line scripts off right in Ruby
http://davetron5000.github.com/optparse-plus
Apache License 2.0
521 stars 54 forks source link

Add rspec support #40

Closed mikegehard closed 12 years ago

mikegehard commented 12 years ago

Allow RSpec users to use the testing framework that they are comfortable with instead of having to use Test::Unit.

davetron5000 commented 12 years ago

Thanks for the merge. I'll release a new gem once the Travis CI tests pass.

mikegehard commented 12 years ago

You are most welcome. Thanks for taking the time to write the gem.

davetron5000 commented 12 years ago

Actually, this leaves the test unit test task in the rakefile. What does the RSpec task look like in a Rakefile? You can just point me to a good example, and I can add it.

mikegehard commented 12 years ago

Oops...I forgot to look at that.

Here is what the Rakefile should look like for RSpec:

require 'bundler' require 'rake/clean' require 'cucumber' require 'rspec/core/rake_task' require 'cucumber/rake/task' gem 'rdoc' # we need the installed RDoc gem, not the system one require 'rdoc/task'

include Rake::DSL

Bundler::GemHelper.install_tasks

RSpec::Core::RakeTask.new do |t| t.pattern = "./spec/*_/__spec.rb" # don't need this, it's default.

Put spec opts in a file named .rspec in root

end

CUKE_RESULTS = 'results.html' CLEAN << CUKE_RESULTS Cucumber::Rake::Task.new(:features) do |t| t.cucumber_opts = "features --format html -o #{CUKE_RESULTS} --format pretty --no-source -x" t.fork = false end

Rake::RDocTask.new do |rd|

rd.main = "README.rdoc"

rd.rdoc_files.include("README.rdoc","lib/*/.rb","bin/*/") end

task :default => [:spec,:features]

mikegehard commented 12 years ago

Looks like it got pasted wrong. I'll work up another commit and get it to you.

davetron5000 commented 12 years ago

I think I have it working. Check out my commit in a sec

Dave

On Saturday, April 21, 2012 at 5:11 PM, Mike Gehard wrote:

Looks like it got pasted wrong. I'll work up another commit and get it to you.


Reply to this email directly or view it on GitHub: https://github.com/davetron5000/methadone/pull/40#issuecomment-5263613

mikegehard commented 12 years ago

OK added a commit to this branch to make the change.

davetron5000 commented 12 years ago

I think we crossed wires; here's what I just put up: f5127944f45e0696d499114a1b6cde0a209deb05

It works from what I can tell…