Created
February 23, 2015 14:32
-
-
Save gonzalo-bulnes/554ac8d2b6b427350dae to your computer and use it in GitHub Desktop.
Split the test suite using RSpec tags.
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
# Rakefile | |
begin | |
require 'rspec/core/rake_task' | |
desc 'Provide private interfaces documentation' | |
RSpec::Core::RakeTask.new(:spec) | |
namespace :spec do | |
desc 'Provide public interfaces documentation' | |
RSpec::Core::RakeTask.new(:public) do |t| | |
# see https://www.relishapp.com/rspec/rspec-core/v/3-2/docs/command-line/tag-option | |
t.rspec_opts = "--tag public" | |
end | |
end | |
namespace :spec do | |
desc 'Provide private interfaces documentation for development purpose' | |
RSpec::Core::RakeTask.new(:development) do |t| | |
# see https://www.relishapp.com/rspec/rspec-core/v/3-2/docs/command-line/tag-option | |
t.rspec_opts = "--tag protected --tag private" | |
end | |
end | |
rescue LoadError | |
desc 'RSpec rake task not available' | |
task :spec do | |
abort 'RSpec rake task is not available. Be sure to install rspec-core as a gem or plugin' | |
end | |
end | |
# ... | |
# task :default => ['spec:public', 'spec:development'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment