testotron 0.0.5 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/testotron.rb +1 -2
- data/lib/tests/http.rb +11 -5
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a4a4bf135594ac12a6f129153cba38464577008
|
4
|
+
data.tar.gz: 375f6cefadb516364a517ade6afe3133d58b1c5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3fda793f194abda163dc0ee75890f042785897e87e0640da451dde715c88b91f5e9193eead9455761df904a5920ffa4e9dfae0f3385f64fb290040457ae1df81
|
7
|
+
data.tar.gz: ea50a288befb0162f9e330612eb9ee7dcaa19068f155f4b80ecc5f88d9bcf52e7a70bcb0ee65ba98258ad0d892e3754c551e84c4eff818c3eb23bf831d468191
|
data/lib/testotron.rb
CHANGED
@@ -49,7 +49,7 @@ module Testotron
|
|
49
49
|
def report_with(*methods)
|
50
50
|
methods = methods.first if methods.length == 1
|
51
51
|
methods = [methods] unless methods.is_a? Array
|
52
|
-
@report_methods = methods.map
|
52
|
+
@report_methods = methods.map(&:to_sym)
|
53
53
|
end
|
54
54
|
|
55
55
|
def complain_using(&block)
|
@@ -124,7 +124,6 @@ EOF
|
|
124
124
|
else
|
125
125
|
raise ArgumentError if args.empty?
|
126
126
|
test = args.shift.to_sym
|
127
|
-
keys = TEST_CLASSES.map { |x| x.const_get(:KEY).to_sym }
|
128
127
|
raise KeyError, "Unknown test: #{test}" unless TEST_CLASSES.map { |x| x.const_get(:KEY).to_sym }.include?(test)
|
129
128
|
TEST_CLASSES.each { |klass|
|
130
129
|
if klass.const_get(:KEY).to_sym == test
|
data/lib/tests/http.rb
CHANGED
@@ -5,11 +5,11 @@ module Testotron
|
|
5
5
|
class HTTP < Test
|
6
6
|
KEY = "http"
|
7
7
|
|
8
|
-
def initialize(host,
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
@
|
8
|
+
def initialize(host, options = {})
|
9
|
+
@host = host
|
10
|
+
@port = options[:port] || 80
|
11
|
+
@requests = [*(options[:requests] || "http://#{host}")]
|
12
|
+
@grep = options[:grep]
|
13
13
|
end
|
14
14
|
|
15
15
|
def human_name
|
@@ -42,6 +42,12 @@ module Testotron
|
|
42
42
|
unless good_codes.include? code
|
43
43
|
raise TestFailed, "Response code #{code} on #{@post}:#{@port} GET #{page}"
|
44
44
|
end
|
45
|
+
|
46
|
+
if @grep
|
47
|
+
unless response.body.include? @grep
|
48
|
+
raise TestFailed, "Response on GET #{page} doesn't match '#@grep'"
|
49
|
+
end
|
50
|
+
end
|
45
51
|
end
|
46
52
|
end
|
47
53
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: testotron
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michal Pokorny
|
@@ -14,14 +14,14 @@ dependencies:
|
|
14
14
|
name: mail
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
description: "\t\tTestotron can automatically test basic functions of common servers,
|
@@ -44,18 +44,19 @@ require_paths:
|
|
44
44
|
- lib
|
45
45
|
required_ruby_version: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- -
|
47
|
+
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: '0'
|
50
50
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
requirements: []
|
56
56
|
rubyforge_project:
|
57
|
-
rubygems_version: 2.0.
|
57
|
+
rubygems_version: 2.0.7
|
58
58
|
signing_key:
|
59
59
|
specification_version: 4
|
60
60
|
summary: Simple server testing
|
61
61
|
test_files: []
|
62
|
+
has_rdoc:
|