uptime_monitor 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/uptime_monitor/browser.rb +4 -5
- data/spec/browser_spec.rb +6 -2
- data/uptime_monitor.gemspec +2 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.6
|
@@ -33,8 +33,7 @@ module Hercules
|
|
33
33
|
end
|
34
34
|
def get_element(first)
|
35
35
|
if (first.is_a? Symbol) || (first.is_a? String)
|
36
|
-
first.to_sym
|
37
|
-
@browser.send(first)
|
36
|
+
@browser.send(first.to_sym)
|
38
37
|
elsif first.is_a? Hash
|
39
38
|
key, value = first.first
|
40
39
|
@browser.send(key, value)
|
@@ -71,7 +70,7 @@ module Hercules
|
|
71
70
|
end
|
72
71
|
def is_an_action?(array)
|
73
72
|
if array.is_a? Array
|
74
|
-
if array.first.is_a?(Symbol) || array.first.is_a?(Hash)
|
73
|
+
if array.first.is_a?(Symbol) || array.first.is_a?(Hash) || array.first.is_a?(String)
|
75
74
|
return true
|
76
75
|
end
|
77
76
|
end
|
@@ -93,8 +92,8 @@ module Hercules
|
|
93
92
|
end
|
94
93
|
end
|
95
94
|
def apply_action?(element, action)
|
96
|
-
if action.is_a?
|
97
|
-
element.send(action)
|
95
|
+
if action.is_a?(Symbol) || action.is_a?(String)
|
96
|
+
element.send(action.to_sym)
|
98
97
|
elsif action.is_a? Hash
|
99
98
|
key, value = action.first
|
100
99
|
element.send(key, value)
|
data/spec/browser_spec.rb
CHANGED
@@ -37,8 +37,9 @@ describe Hercules::UptimeMonitor::Browser do
|
|
37
37
|
it "cannot apply action in wrong form" do
|
38
38
|
element = @browser.get_element({text_field: {id: "s"}})
|
39
39
|
element.exists?.should == true
|
40
|
-
expect{@browser.apply_action?(element,
|
40
|
+
expect{@browser.apply_action?(element, 1)}.to raise_error(Hercules::UptimeMonitor::InvalidAction)
|
41
41
|
end
|
42
|
+
|
42
43
|
it "returns true for matching text form" do
|
43
44
|
@browser.apply_text?("hello world", {text: "hello world"}).should == true
|
44
45
|
end
|
@@ -65,9 +66,12 @@ describe Hercules::UptimeMonitor::Browser do
|
|
65
66
|
@browser.is_an_action?([set: "admin"]).should == true
|
66
67
|
@browser.is_an_action?([:click]).should == true
|
67
68
|
end
|
69
|
+
it "can detect actions in string form" do
|
70
|
+
@browser.is_an_action?(["click"]).should == true
|
71
|
+
end
|
68
72
|
it "can detect invalid action form" do
|
69
73
|
@browser.is_an_action?("something_else").should == false
|
70
|
-
@browser.is_an_action?([
|
74
|
+
@browser.is_an_action?([1]).should == false
|
71
75
|
end
|
72
76
|
it "can detect valid text form" do
|
73
77
|
@browser.is_a_text?([{text: "hello world"}]).should == true
|
data/uptime_monitor.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "uptime_monitor"
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["obi-a"]
|
12
|
-
s.date = "2014-04-
|
12
|
+
s.date = "2014-04-13"
|
13
13
|
s.description = "A Ragios plugin that uses a real web browser to monitor transactions on a website for availability"
|
14
14
|
s.email = "obioraakubue@yahoo.com"
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uptime_monitor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-04-
|
12
|
+
date: 2014-04-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: headless
|
@@ -196,7 +196,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
196
196
|
version: '0'
|
197
197
|
segments:
|
198
198
|
- 0
|
199
|
-
hash:
|
199
|
+
hash: 4402610893578547372
|
200
200
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
201
201
|
none: false
|
202
202
|
requirements:
|