averell23-watchdogger 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -34,7 +34,7 @@ module Watcher
34
34
  http.get(url.path)
35
35
  end
36
36
  test_failed = false
37
- if(@response && (@response != res.code))
37
+ if(@response && (@response.to_s != res.code))
38
38
  test_failed = "Unexpected HTTP response: #{res.code} for #{@url} - expected #{@response}"
39
39
  elsif(@content_match && !@content_match.match(res.body))
40
40
  test_failed = "Did not find #{@content_match.to_s} at #{@url}"
@@ -32,6 +32,12 @@ class HttpWatcherTest < Test::Unit::TestCase
32
32
  assert_equal(false, watcher.watch_it!)
33
33
  end
34
34
 
35
+ def test_simple_response_numerical
36
+ @default_options[:response] = 200
37
+ watcher = Watcher::HttpWatcher.new(@default_options)
38
+ assert_equal(false, watcher.watch_it!)
39
+ end
40
+
35
41
  def test_404_response
36
42
  @default_options[:url] = TEST_URL + '/narfnarf'
37
43
  @default_options[:response] = '404'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: averell23-watchdogger
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
  - Daniel Hahn