Skip to content

Instantly share code, notes, and snippets.

@gonzalo-bulnes
Created February 23, 2015 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gonzalo-bulnes/554ac8d2b6b427350dae to your computer and use it in GitHub Desktop.
Save gonzalo-bulnes/554ac8d2b6b427350dae to your computer and use it in GitHub Desktop.
Split the test suite using RSpec tags.
# 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