File: spec.rake

package info (click to toggle)
ruby-tty-screen 0.8.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 220 kB
  • sloc: ruby: 483; makefile: 4; sh: 4
file content (34 lines) | stat: -rw-r--r-- 847 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# frozen_string_literal: true

begin
  require "rspec/core/rake_task"

  desc "Run all specs"
  RSpec::Core::RakeTask.new(:spec) do |task|
    task.pattern = "spec/{unit,integration}{,/*/**}/*_spec.rb"
  end

  namespace :spec do
    desc "Run unit specs"
    RSpec::Core::RakeTask.new(:unit) do |task|
      task.pattern = "spec/unit{,/*/**}/*_spec.rb"
    end

    desc "Run integration specs"
    RSpec::Core::RakeTask.new(:integration) do |task|
      task.pattern = "spec/integration{,/*/**}/*_spec.rb"
    end

    desc "Run performance specs"
    RSpec::Core::RakeTask.new(:perf) do |task|
      task.pattern = "spec/perf{,/*/**}/*_spec.rb"
    end
  end

rescue LoadError
  %w[spec spec:unit spec:integration spec:perf].each do |name|
    task name do
      $stderr.puts "In order to run #{name}, do `gem install rspec`"
    end
  end
end