gmalamid-synthesis 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -7,7 +7,7 @@ require File.dirname(__FILE__) + "/lib/synthesis/task"
7
7
 
8
8
  load 'synthesis.gemspec'
9
9
 
10
- task :default => :test
10
+ task :default => [:test, "test_project:all"]
11
11
 
12
12
  desc "Run all tests"
13
13
  task :test => %w[test:core test:mocha test:spec]
@@ -43,6 +43,26 @@ Synthesis::Task.new('synthesis:spec') do |t|
43
43
  t.pattern = 'test_project/rspec/*_spec.rb'
44
44
  end
45
45
 
46
+ namespace :test_project do
47
+ task :all do
48
+ STDOUT.puts `rake test_project:mocha`
49
+ STDOUT.puts `rake test_project:rspec`
50
+ STDOUT.puts `rake test_project:expectations`
51
+ end
52
+
53
+ Rake::TestTask.new('mocha') do |t|
54
+ t.pattern = 'test_project/mocha/**/*_test.rb'
55
+ end
56
+
57
+ Rake::TestTask.new('rspec') do |t|
58
+ t.pattern = 'test_project/mocha/**/*_test.rb'
59
+ end
60
+
61
+ Rake::TestTask.new('expectations') do |t|
62
+ t.pattern = 'test_project/mocha/**/*_test.rb'
63
+ end
64
+ end
65
+
46
66
  desc 'Generate RDoc'
47
67
  Rake::RDocTask.new do |task|
48
68
  task.main = 'README'
@@ -66,7 +86,7 @@ end
66
86
  desc "Remove rdoc and package artefacts"
67
87
  task :clean => %w[clobber_package clobber_rdoc]
68
88
 
69
- task(:lf) {p Dir["lib/**/*rb"] }
89
+ task(:lf) {p Dir["lib/**/*rb"]}
70
90
 
71
91
  task(:check_gemspec) do
72
92
  require 'rubygems/specification'
@@ -8,7 +8,7 @@ module Synthesis
8
8
  class MochaAdapter < Adapter
9
9
  def run
10
10
  Test::Unit.run = true # Yes means no...
11
- fail_unless { Test::Unit::AutoRunner.run }
11
+ fail_unless { Test::Unit::AutoRunner.run(false, nil, []) }
12
12
  end
13
13
 
14
14
  def collect_expectations
@@ -7,11 +7,11 @@ require File.dirname(__FILE__) + "/../../synthesis"
7
7
  module Synthesis
8
8
  class RSpecAdapter < Adapter
9
9
  def run
10
- rspec_options.files.clear
10
+ Synthesis.rspec_runner_options.files.clear
11
11
  fail_unless do
12
- rspec_options.instance_variable_set(:@formatters, nil)
13
- # rspec_options.instance_variable_set(:@format_options, [["profile", STDOUT]])
14
- rspec_options.run_examples
12
+ Synthesis.rspec_runner_options.instance_variable_set(:@formatters, nil)
13
+ # Synthesis.rspec_runner_options.instance_variable_set(:@format_options, [["profile", STDOUT]])
14
+ Synthesis.rspec_runner_options.run_examples
15
15
  end
16
16
  end
17
17
 
@@ -30,5 +30,11 @@ module Synthesis
30
30
  Spec::Mocks::MessageExpectation.stop_intercepting!
31
31
  Spec::Mocks::Methods.stop_recording!
32
32
  end
33
- end
33
+ end
34
+
35
+ def rspec_runner_options
36
+ Spec::Runner.options rescue rspec_options
37
+ end
38
+
39
+ module_function :rspec_runner_options
34
40
  end
@@ -1,7 +1,7 @@
1
1
  module Synthesis
2
2
  module Recordable
3
3
  def recordable_method(meth)
4
- if method_defined?(meth)
4
+ if method_defined?(meth) || private_method_defined?(meth)
5
5
  defined_recordable_method(meth)
6
6
  else
7
7
  magic_recordable_method(meth)
@@ -9,7 +9,7 @@ module Synthesis
9
9
  attr_accessor :verbose, :pattern, :ruby_opts, :adapter, :out, :ignored, :libs
10
10
 
11
11
  def initialize(name='synthesis:test')
12
- @name, @ignored, @libs = name, [], ['lib']
12
+ @name, @ignored, @libs = name, [], []
13
13
  yield self if block_given?
14
14
  @pattern ||= 'test/**/*_test.rb'
15
15
  @ruby_opts ||= []
data/synthesis.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  GEMSPEC =Gem::Specification.new do |s|
2
2
  s.name = 'synthesis'
3
- s.version = '0.1.6'
3
+ s.version = '0.1.7'
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.rubyforge_project = "synthesis"
6
6
  s.summary, s.description = 'A tool for Synthesized Testing'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gmalamid-synthesis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stuart Caborn, George Malamidis
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-07-08 00:00:00 -07:00
12
+ date: 2008-10-09 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15