mocha 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/RELEASE +4 -0
  2. data/Rakefile +1 -1
  3. data/test/mocha_acceptance_test.rb +16 -16
  4. metadata +2 -2
data/RELEASE CHANGED
@@ -1,3 +1,7 @@
1
+ = 0.2.1
2
+
3
+ * Rename MochaAcceptanceTest::Rover#move method to avoid conflict with Rake (in Ruby 1.8.4 only?)
4
+
1
5
  = 0.2.0
2
6
 
3
7
  * Small change to SetupAndTeardown#teardown_stubs suggested by Luke Redpath (http://www.lukeredpath.co.uk) to allow use of Stubba with RSpec (http://rspec.rubyforge.org).
data/Rakefile CHANGED
@@ -47,7 +47,7 @@ Gem::manage_gems
47
47
  specification = Gem::Specification.new do |s|
48
48
  s.name = "mocha"
49
49
  s.summary = "Mocking and stubbing library"
50
- s.version = "0.2.0"
50
+ s.version = "0.2.1"
51
51
  s.author = 'James Mead'
52
52
  s.description = <<-EOF
53
53
  Mocking and stubbing library with JMock/SchMock syntax, which allows mocking and stubbing of methods on real (non-mock) classes.
@@ -10,8 +10,8 @@ class MochaAcceptanceTest < Test::Unit::TestCase
10
10
  end
11
11
 
12
12
  def forward(metres)
13
- @left_track.move(metres * @steps_per_metre)
14
- @right_track.move(metres * @steps_per_metre)
13
+ @left_track.step(metres * @steps_per_metre)
14
+ @right_track.step(metres * @steps_per_metre)
15
15
  wait
16
16
  end
17
17
 
@@ -20,8 +20,8 @@ class MochaAcceptanceTest < Test::Unit::TestCase
20
20
  end
21
21
 
22
22
  def left(degrees)
23
- @left_track.move(-degrees * @steps_per_degree)
24
- @right_track.move(+degrees * @steps_per_degree)
23
+ @left_track.step(-degrees * @steps_per_degree)
24
+ @right_track.step(+degrees * @steps_per_degree)
25
25
  wait
26
26
  end
27
27
 
@@ -35,14 +35,14 @@ class MochaAcceptanceTest < Test::Unit::TestCase
35
35
 
36
36
  end
37
37
 
38
- def test_should_move_both_tracks_forward_ten_steps
38
+ def test_should_step_both_tracks_forward_ten_steps
39
39
  left_track = mock()
40
40
  right_track = mock()
41
41
  steps_per_metre = 5
42
42
  rover = Rover.new(left_track, right_track, steps_per_metre, nil)
43
43
 
44
- left_track.expects(:move).with(10)
45
- right_track.expects(:move).with(10)
44
+ left_track.expects(:step).with(10)
45
+ right_track.expects(:step).with(10)
46
46
 
47
47
  left_track.stubs(:moving?).returns(false)
48
48
  right_track.stubs(:moving?).returns(false)
@@ -50,14 +50,14 @@ class MochaAcceptanceTest < Test::Unit::TestCase
50
50
  rover.forward(2)
51
51
  end
52
52
 
53
- def test_should_move_both_tracks_backward_ten_steps
53
+ def test_should_step_both_tracks_backward_ten_steps
54
54
  left_track = mock()
55
55
  right_track = mock()
56
56
  steps_per_metre = 5
57
57
  rover = Rover.new(left_track, right_track, steps_per_metre, nil)
58
58
 
59
- left_track.expects(:move).with(-10)
60
- right_track.expects(:move).with(-10)
59
+ left_track.expects(:step).with(-10)
60
+ right_track.expects(:step).with(-10)
61
61
 
62
62
  left_track.stubs(:moving?).returns(false)
63
63
  right_track.stubs(:moving?).returns(false)
@@ -65,14 +65,14 @@ class MochaAcceptanceTest < Test::Unit::TestCase
65
65
  rover.backward(2)
66
66
  end
67
67
 
68
- def test_should_move_left_track_forwards_five_steps_and_right_track_backwards_five_steps
68
+ def test_should_step_left_track_forwards_five_steps_and_right_track_backwards_five_steps
69
69
  left_track = mock()
70
70
  right_track = mock()
71
71
  steps_per_degree = 5.0 / 90.0
72
72
  rover = Rover.new(left_track, right_track, nil, steps_per_degree)
73
73
 
74
- left_track.expects(:move).with(+5)
75
- right_track.expects(:move).with(-5)
74
+ left_track.expects(:step).with(+5)
75
+ right_track.expects(:step).with(-5)
76
76
 
77
77
  left_track.stubs(:moving?).returns(false)
78
78
  right_track.stubs(:moving?).returns(false)
@@ -80,14 +80,14 @@ class MochaAcceptanceTest < Test::Unit::TestCase
80
80
  rover.right(90)
81
81
  end
82
82
 
83
- def test_should_move_left_track_backwards_five_steps_and_right_track_forwards_five_steps
83
+ def test_should_step_left_track_backwards_five_steps_and_right_track_forwards_five_steps
84
84
  left_track = mock()
85
85
  right_track = mock()
86
86
  steps_per_degree = 5.0 / 90.0
87
87
  rover = Rover.new(left_track, right_track, nil, steps_per_degree)
88
88
 
89
- left_track.expects(:move).with(-5)
90
- right_track.expects(:move).with(+5)
89
+ left_track.expects(:step).with(-5)
90
+ right_track.expects(:step).with(+5)
91
91
 
92
92
  left_track.stubs(:moving?).returns(false)
93
93
  right_track.stubs(:moving?).returns(false)
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: mocha
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.2.0
7
- date: 2006-08-11 00:00:00 +01:00
6
+ version: 0.2.1
7
+ date: 2006-08-14 00:00:00 +01:00
8
8
  summary: Mocking and stubbing library
9
9
  require_paths:
10
10
  - lib