File: ruby-tests.rake

package info (click to toggle)
nanoc 4.11.23-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,152 kB
  • sloc: ruby: 39,280; sh: 27; makefile: 16
file content (41 lines) | stat: -rw-r--r-- 1,093 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
35
36
37
38
39
40
41
require 'gem2deb/rake/spectask'
require 'gem2deb/rake/testtask'

EXCLUDED_TESTS=['nanoc/test/filters/test_markaby.rb',
                'nanoc/test/filters/test_rainpress.rb']

Gem2Deb::Rake::TestTask.new(:test_nanoc) do |t|
  t.libs = ['nanoc/test', 'nanoc/lib', 'nanoc-core/lib', 'nanoc-cli/lib', 'nanoc-spec/lib']
  t.test_files = FileList['nanoc/test/**/*_spec.rb'] + FileList['nanoc/test/**/test_*.rb']-EXCLUDED_TESTS
end
task default: :test_nanoc

ENV["RUBYLIB"] ||= ""
ENV["RUBYLIB"] += ":" + File.expand_path(File.dirname(__FILE__) + "/../nanoc-spec/lib")


%w[
  nanoc
  nanoc-core
  nanoc-cli
  nanoc-live
  nanoc-external
  nanoc-checking
  nanoc-deploying
].each do |subproject|
  task "spec-#{subproject}" do
    Dir.chdir(subproject) do |dir|
      puts "======= entering ./#{dir}/"
      puts
      begin
        mv 'lib',  'lib.off'
        ruby "-S", "rspec", "--exclude-pattern=spec/**/{gem,meta,manifest}_spec.rb"
      ensure
        mv 'lib.off',  'lib'
        puts
        puts "======= exiting ./#{dir}/"
      end
    end
  end
  task default: "spec-#{subproject}"
end