synthesis 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -58,7 +58,7 @@ end
58
58
 
59
59
  gem_spec = Gem::Specification.new do |s|
60
60
  s.name = 'synthesis'
61
- s.version = '0.1.3'
61
+ s.version = '0.1.4'
62
62
  s.platform = Gem::Platform::RUBY
63
63
  s.rubyforge_project = "synthesis"
64
64
  s.summary, s.description = 'A tool for Synthesized Testing'
@@ -11,12 +11,17 @@ module Synthesis
11
11
  class_eval do
12
12
  alias_method "intercepted_#{method_name}", method_name
13
13
 
14
- define_method(method_name) do |meth|
14
+ define_method(:get_expectation_method_name) {method_name}
15
+
16
+ def temp_expectation_record(meth, *expected_parameters, &matching_block)
15
17
  s_expectation = ExpectationRecord.add_expectation(self, meth, caller[0])
16
- m_expectation = send("intercepted_#{method_name}", meth)
18
+ m_expectation = send("intercepted_#{get_expectation_method_name}", meth, *expected_parameters, &matching_block)
17
19
  m_expectation.synthesis_expectation = s_expectation
18
20
  m_expectation
19
21
  end
22
+
23
+ alias_method method_name, :temp_expectation_record
24
+ undef temp_expectation_record
20
25
  end
21
26
  end
22
27
 
@@ -27,6 +32,7 @@ module Synthesis
27
32
  class_eval do
28
33
  alias_method method_name, "intercepted_#{method_name}"
29
34
  remove_method "intercepted_#{method_name}"
35
+ remove_method :get_expectation_method_name
30
36
  end
31
37
  end
32
38
  end
@@ -3,7 +3,7 @@ module Synthesis
3
3
  def self.run(adapter, pattern)
4
4
  require "synthesis/adapter/#{adapter}"
5
5
  Adapter.load(pattern).run
6
- exit Reporter.report unless $!
6
+ at_exit { Reporter.report unless $! }
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: synthesis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
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-06-05 00:00:00 +01:00
12
+ date: 2008-06-16 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies: []
15
15