File: Rakefile

package info (click to toggle)
rails 2%3A7.2.2.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 43,348 kB
  • sloc: ruby: 349,797; javascript: 30,703; yacc: 46; sql: 43; sh: 29; makefile: 27
file content (56 lines) | stat: -rw-r--r-- 1,478 bytes parent folder | download | duplicates (2)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# frozen_string_literal: true

require "rake/testtask"
require "fileutils"
require "open3"
require "base64"

desc "Default Task"
task default: :test

# Run the unit tests

desc "Run all unit tests"
task test: ["test:template", "test:integration:action_pack", "test:integration:active_record"]

namespace :test do
  task :isolated do
    Dir.glob("test/{actionpack,activerecord,template}/**/*_test.rb").all? do |file|
      sh(Gem.ruby, "-w", "-Ilib:test", file)
    end || raise("Failures")
  end

  Rake::TestTask.new(:template) do |t|
    t.libs << "test"
    t.test_files = FileList["test/template/**/*_test.rb"]
    t.warning = true
    t.verbose = true
    t.ruby_opts = ["--dev"] if defined?(JRUBY_VERSION)
  end

  namespace :integration do
    # Active Record Integration Tests
    Rake::TestTask.new(:active_record) do |t|
      t.libs << "test"
      t.test_files = FileList["test/activerecord/*_test.rb"]
      t.warning = true
      t.verbose = true
      t.ruby_opts = ["--dev"] if defined?(JRUBY_VERSION)
    end

    # Action Pack Integration Tests
    Rake::TestTask.new(:action_pack) do |t|
      t.libs << "test"
      t.test_files = FileList["test/actionpack/**/*_test.rb"]
      t.warning = true
      t.verbose = true
      t.ruby_opts = ["--dev"] if defined?(JRUBY_VERSION)
    end
  end
end

task :lines do
  load File.expand_path("../tools/line_statistics", __dir__)
  files = FileList["lib/**/*.rb"]
  CodeTools::LineStatistics.new(files).print_loc
end