mimic 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.4.1
2
+
3
+ * Fixed bug where stubs wouldn't actually be cleared correctly.
4
+
1
5
  ## 0.4.0
2
6
 
3
7
  * Mimic can now be run in it's own process and configured externally using a REST API.
data/Rakefile CHANGED
@@ -27,7 +27,7 @@ spec = Gem::Specification.new do |s|
27
27
 
28
28
  # Change these as appropriate
29
29
  s.name = "mimic"
30
- s.version = "0.4.0"
30
+ s.version = "0.4.1"
31
31
  s.summary = "A Ruby gem for faking external web services for testing"
32
32
  s.authors = "Luke Redpath"
33
33
  s.email = "luke@lukeredpath.co.uk"
@@ -26,8 +26,9 @@ module Mimic
26
26
  end
27
27
 
28
28
  post "/clear" do
29
+ response_body = self.host.inspect
29
30
  self.host.clear
30
- [200, {}, ""]
31
+ [200, {}, "Cleared stubs: #{response_body}"]
31
32
  end
32
33
 
33
34
  private
@@ -7,14 +7,8 @@ module Mimic
7
7
 
8
8
  def initialize(hostname, remote_configuration_path = nil)
9
9
  @hostname = hostname
10
- @stubs = []
11
- @app = Class.new(Sinatra::Base)
12
10
  @remote_configuration_path = remote_configuration_path
13
-
14
- @app.not_found do
15
- [404, {}, ""]
16
- end
17
-
11
+ clear
18
12
  build_url_map!
19
13
  end
20
14
 
@@ -50,7 +44,15 @@ module Mimic
50
44
  end
51
45
 
52
46
  def clear
53
- @stubs.clear
47
+ @stubs = []
48
+ @app = Class.new(Sinatra::Base)
49
+ @app.not_found do
50
+ [404, {}, ""]
51
+ end
52
+ end
53
+
54
+ def inspect
55
+ @stubs.inspect
54
56
  end
55
57
 
56
58
  private
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mimic
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 0
10
- version: 0.4.0
9
+ - 1
10
+ version: 0.4.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Luke Redpath