-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from shwoodard/fix_cli
Fix cli
- Loading branch information
Showing
9 changed files
with
58 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,9 @@ | ||
require "bundler/gem_tasks" | ||
require 'rspec/core/rake_task' | ||
require 'cucumber/rake/task' | ||
|
||
desc "Run specs" | ||
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 | ||
RSpec::Core::RakeTask.new :spec | ||
Cucumber::Rake::Task.new | ||
|
||
desc "Generate code coverage" | ||
RSpec::Core::RakeTask.new(:coverage) do |t| | ||
t.pattern = "./spec/**/*_spec.rb" # don't need this, it's default. | ||
t.rcov = true | ||
t.rcov_opts = ['--exclude', 'spec'] | ||
end | ||
|
||
|
||
namespace :spec do | ||
desc 'Create spec' | ||
task :create, :path do |t, args| | ||
spec_path = File.join('spec', args[:path].gsub(%r{.rb$}, '_spec.rb')) | ||
klass = File.basename(args[:path], File.extname(args[:path])).split('_').map {|s| "#{s[0,1].upcase}#{s[1..-1]}" }.join | ||
mkdir_p File.dirname(spec_path) | ||
|
||
spec_doc = <<-EOS | ||
require 'spec_helper' | ||
describe #{klass} do | ||
end | ||
EOS | ||
|
||
File.open(spec_path, 'w+') do |f| | ||
f.puts spec_doc | ||
end | ||
|
||
puts spec_doc | ||
end | ||
end | ||
|
||
desc "Run cucumber" | ||
task(:cucumber) { sh 'cucumber' } | ||
|
||
desc 'Default: run specs.' | ||
task :default => :spec | ||
desc 'Default: run specs and features.' | ||
task :default => [:spec, :cucumber] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters