flexmock 0.8.4 → 0.8.5

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,5 +1,11 @@
1
1
  = Changes for FlexMock
2
2
 
3
+ == Version 0.8.5
4
+
5
+ * Fixed warning about a void context.
6
+ * hsh() argument matcher now reports its matching constraints in error
7
+ messages.
8
+
3
9
  == Version 0.8.4
4
10
 
5
11
  * Added support for rails 2.2.x in should_render_view.
data/Rakefile CHANGED
@@ -19,7 +19,7 @@ require 'rake/contrib/rubyforgepublisher'
19
19
  CLEAN.include('*.tmp')
20
20
  CLOBBER.include("html", 'pkg')
21
21
 
22
- PKG_VERSION = '0.8.4'
22
+ PKG_VERSION = '0.8.5'
23
23
 
24
24
  PKG_FILES = FileList[
25
25
  '[A-Z]*',
@@ -0,0 +1,95 @@
1
+ = FlexMock 0.8.5 Released
2
+
3
+ FlexMock is a flexible mocking library for use in unit testing and
4
+ behavior specification in Ruby. Release 0.8.5 is a minor release with
5
+ a few bug fixes.
6
+
7
+ == Bug Fixes in 0.8.5
8
+
9
+ * Fixed warning about a void context.
10
+ * hsh() argument matcher now reports its matching constraints in error
11
+ messages.
12
+
13
+ == What is FlexMock?
14
+
15
+ FlexMock is a flexible framework for creating mock object for testing. When
16
+ running unit tests, it is often desirable to use isolate the objects being
17
+ tested from the "real world" by having them interact with simplified test
18
+ objects. Sometimes these test objects simply return values when called, other
19
+ times they verify that certain methods were called with particular arguments
20
+ in a particular order.
21
+
22
+ FlexMock makes creating these test objects easy.
23
+
24
+ === Features
25
+
26
+ * Easy integration with both Test::Unit and RSpec. Mocks created with the
27
+ flexmock method are automatically verified at the end of the test or
28
+ example.
29
+
30
+ * A fluent interface that allows mock behavior to be specified very
31
+ easily.
32
+
33
+ * A "record mode" where an existing implementation can record its
34
+ interaction with a mock for later validation against a new
35
+ implementation.
36
+
37
+ * Easy mocking of individual methods in existing, non-mock objects.
38
+
39
+ * Easy mocking of chains of method calls.
40
+
41
+ * The ability to cause classes to instantiate test instances (instead of real
42
+ instances) for the duration of a test.
43
+
44
+ === Example
45
+
46
+ Suppose you had a Dog object that wagged a tail when it was happy.
47
+ Something like this:
48
+
49
+ class Dog
50
+ def initialize(a_tail)
51
+ @tail = a_tail
52
+ end
53
+ def happy
54
+ @tail.wag
55
+ end
56
+ end
57
+
58
+ To test the +Dog+ class without a real +Tail+ object (perhaps because
59
+ real +Tail+ objects activate servos in some robotic equipment), you
60
+ can do something like this:
61
+
62
+ require 'test/unit'
63
+ require 'flexmock/test_unit'
64
+
65
+ class TestDog < Test::Unit::TestCase
66
+ def test_dog_wags_tail_when_happy
67
+ tail = flexmock("tail")
68
+ tail.should_receive(:wag).once
69
+ dog = Dog.new(tail)
70
+ dog.happy
71
+ end
72
+ end
73
+
74
+ FlexMock will automatically verify that the mocked tail object received the
75
+ message +wag+ exactly one time. If it doesn't, the test will not pass.
76
+
77
+ See the FlexMock documentation at http://flexmock.rubyforge.org for details on
78
+ specifying arguments and return values on mocked methods, as well as a simple
79
+ technique for mocking tail objects when the Dog class creates the tail objects
80
+ directly.
81
+
82
+ == Availability
83
+
84
+ You can make sure you have the latest version with a quick RubyGems command:
85
+
86
+ gem install flexmock (you may need root/admin privileges)
87
+
88
+ Otherwise, you can get it from the more traditional places:
89
+
90
+ Download:: http://rubyforge.org/project/showfiles.php?group_id=170
91
+
92
+ You will find documentation at: http://flexmock.rubyforge.org.
93
+
94
+ -- Jim Weirich
95
+
@@ -64,7 +64,6 @@ class FlexMock
64
64
  end
65
65
  def inspect
66
66
  "hsh(#{@hash.inspect})"
67
- "hsh(...)"
68
67
  end
69
68
  end
70
69
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flexmock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.4
4
+ version: 0.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Weirich
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-19 00:00:00 -08:00
12
+ date: 2009-03-10 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -40,6 +40,7 @@ extra_rdoc_files:
40
40
  - doc/releases/flexmock-0.8.2.rdoc
41
41
  - doc/releases/flexmock-0.8.3.rdoc
42
42
  - doc/releases/flexmock-0.8.4.rdoc
43
+ - doc/releases/flexmock-0.8.5.rdoc
43
44
  files:
44
45
  - CHANGES
45
46
  - Rakefile
@@ -111,6 +112,7 @@ files:
111
112
  - doc/releases/flexmock-0.8.2.rdoc
112
113
  - doc/releases/flexmock-0.8.3.rdoc
113
114
  - doc/releases/flexmock-0.8.4.rdoc
115
+ - doc/releases/flexmock-0.8.5.rdoc
114
116
  has_rdoc: true
115
117
  homepage: http://flexmock.rubyforge.org
116
118
  post_install_message: