public
Description: Ruby code analysis tool for verifying mock object assumptions in tests
Homepage: http://synthesis.rubyforge.org
Clone URL: git://github.com/gmalamid/synthesis.git
gmalamid (author)
Mon Jul 06 15:52:20 -0700 2009
commit  98bb354559757e116ca99992661327e22cdc0b51
tree    d59a55b1abf9f5694126e154ebadc0f89c580214
parent  73e7b24c9fc2f189025b5cda81fe8af127e6c8fb
synthesis / Rakefile
100644 91 lines (73 sloc) 2.257 kb
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
require "rubygems"
require "rake/testtask"
require 'rake/rdoctask'
require 'rake/contrib/sshpublisher'
require File.dirname(__FILE__) + "/lib/synthesis/task"
 
load 'synthesis.gemspec'
 
task :default => [:test, "test_project:all"]
 
desc "Run all tests"
task :test => %w[test:core test:mocha test:spec]
 
desc "Run core tests"
Rake::TestTask.new('test:core') do |t|
  t.pattern = '{test/synthesis/,test/synthesis/formatter/}*_test.rb'
end
 
desc "Run Mocha adapter tests"
Rake::TestTask.new('test:mocha') do |t|
  t.pattern = 'test/synthesis/adapter/mocha/*_test.rb'
end
 
desc "Run RSpec adapter tests"
Rake::TestTask.new('test:spec') do |t|
  t.pattern = 'test/synthesis/adapter/rspec/*_test.rb'
end
 
# Synthesis test_project tasks
 
Synthesis::Task.new do |t|
  t.pattern = 'test_project/mocha/test/*_test.rb'
  t.ignored = [Array, Hash]
  # t.out = File.new('synthesis.test.txt', 'a')
end
 
Synthesis::Task.new('synthesis:test:graph') do |t|
  t.pattern = 'test_project/mocha/test/*_test.rb'
  t.formatter = :dot
end
 
Synthesis::Task.new('synthesis:spec') do |t|
  t.adapter = :rspec
  t.pattern = 'test_project/rspec/*_spec.rb'
end
 
Synthesis::Task.new('synthesis:spec:graph') do |t|
  t.adapter = :rspec
  t.pattern = 'test_project/rspec/*_spec.rb'
  t.formatter = :dot
end
 
namespace :test_project do
  task :all do
    STDOUT.puts `rake test_project:mocha`
    STDOUT.puts `rake test_project:rspec`
  end
  
  Rake::TestTask.new('mocha') do |t|
    t.pattern = 'test_project/mocha/**/*_test.rb'
  end
  
  Rake::TestTask.new('rspec') do |t|
    t.pattern = 'test_project/mocha/**/*_test.rb'
  end
end
 
desc 'Generate RDoc'
Rake::RDocTask.new do |task|
  task.main = 'README.rdoc'
  task.title = 'synthesis'
  task.rdoc_dir = 'doc'
  task.options << "--line-numbers" << "--inline-source"
  task.rdoc_files.include('README.rdoc', 'lib/**/*.rb')
end
 
desc "Upload RDoc to RubyForge"
task :publish_rdoc do
  Rake::Task[:rdoc].invoke
  Rake::SshDirPublisher.new("gmalamid@rubyforge.org", "/var/www/gforge-projects/synthesis", "doc").upload
end
 
task(:lf) {p Dir["lib/**/*rb"]}
 
task(:check_gemspec) do
  require 'rubygems/specification'
  data = File.read('synthesis.gemspec')
  spec = nil
  Thread.new { spec = eval("$SAFE = 3\n#{data}") }.join
  puts spec
end