Created
December 29, 2011 16:16
-
-
Save gitkeeper/1534787 to your computer and use it in GitHub Desktop.
General purpose RSpec Rake tasks - useful for most projects.
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
require "rspec/core/rake_task" | |
namespace :spec do | |
default_opts = ["--format progress", "--color"] | |
desc "Run all specs" | |
RSpec::Core::RakeTask.new(:all) do |t| | |
t.rspec_opts = [*default_opts] | |
end | |
desc "Run all specs that should pass" | |
RSpec::Core::RakeTask.new(:ok) do |t| | |
t.rspec_opts = [*default_opts, "--tag ~wip"] | |
end | |
desc "Run specs that are being worked on" | |
RSpec::Core::RakeTask.new(:wip) do |t| | |
t.rspec_opts = [*default_opts, "--tag wip"] | |
end | |
desc "Run all specs and show the ten slowest examples" | |
RSpec::Core::RakeTask.new(:profile) do |t| | |
t.rspec_opts = [*default_opts, "--profile", "--tag ~wip"] | |
end | |
end | |
desc "Alias for spec:ok" | |
task spec: "spec:ok" |
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
RSpec.configure do |c| | |
c.treat_symbols_as_metadata_keys_with_true_values = true | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment