sapphire 0.6.7 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sapphire.rb +3 -2
- data/lib/sapphire/Adapters/Selenium/RubySeleniumWebDriver.rb +43 -27
- data/lib/sapphire/Configuration/AppConfig.rb +1 -1
- data/lib/sapphire/DSL.rb +6 -1
- data/lib/sapphire/DSL/Browser/ExecuteAgainstControl.rb +6 -20
- data/lib/sapphire/DSL/Browser/Fluff/Be.rb +10 -0
- data/lib/sapphire/DSL/Browser/Fluff/By.rb +2 -2
- data/lib/sapphire/DSL/Browser/Fluff/Have.rb +10 -0
- data/lib/sapphire/DSL/Browser/Fluff/To.rb +2 -2
- data/lib/sapphire/DSL/Browser/For.rb +9 -10
- data/lib/sapphire/DSL/Browser/Nouns/Browser.rb +2 -2
- data/lib/sapphire/DSL/Browser/Nouns/Day.rb +42 -24
- data/lib/sapphire/DSL/Browser/Nouns/Enter.rb +1 -1
- data/lib/sapphire/DSL/Browser/Nouns/Month.rb +42 -24
- data/lib/sapphire/DSL/Browser/Nouns/Popup.rb +2 -2
- data/lib/sapphire/DSL/Browser/Nouns/Second.rb +42 -0
- data/lib/sapphire/DSL/Browser/Should.rb +1 -46
- data/lib/sapphire/DSL/Browser/Verbs/Accept.rb +1 -2
- data/lib/sapphire/DSL/Browser/Verbs/Check.rb +0 -1
- data/lib/sapphire/DSL/Browser/Verbs/Click.rb +0 -1
- data/lib/sapphire/DSL/Browser/Verbs/Compare.rb +5 -5
- data/lib/sapphire/DSL/Browser/Verbs/Complete.rb +2 -2
- data/lib/sapphire/DSL/Browser/Verbs/Disable.rb +1 -1
- data/lib/sapphire/DSL/Browser/Verbs/Exists.rb +6 -11
- data/lib/sapphire/DSL/Browser/Verbs/{Close.rb → Exit.rb} +0 -0
- data/lib/sapphire/DSL/Browser/Verbs/Has.rb +9 -0
- data/lib/sapphire/DSL/Browser/Verbs/MouseOver.rb +0 -1
- data/lib/sapphire/DSL/Browser/Verbs/Navigate.rb +1 -2
- data/lib/sapphire/DSL/Browser/Verbs/On.rb +19 -0
- data/lib/sapphire/DSL/Browser/Verbs/Press.rb +1 -1
- data/lib/sapphire/DSL/Browser/Verbs/Reload.rb +1 -1
- data/lib/sapphire/DSL/Browser/Verbs/Remove.rb +22 -0
- data/lib/sapphire/DSL/Browser/Verbs/Set.rb +1 -1
- data/lib/sapphire/DSL/Browser/Verbs/Start.rb +14 -16
- data/lib/sapphire/DSL/Browser/Verbs/Uncheck.rb +0 -1
- data/lib/sapphire/DSL/Comparisons/CheckedComparison.rb +17 -0
- data/lib/sapphire/DSL/Comparisons/Comparison.rb +34 -0
- data/lib/sapphire/DSL/Comparisons/ContainsComparison.rb +17 -0
- data/lib/sapphire/DSL/Comparisons/DifferComparison.rb +17 -0
- data/lib/sapphire/DSL/Comparisons/EqualsComparison.rb +16 -0
- data/lib/sapphire/DSL/Comparisons/NotComparison.rb +21 -0
- data/lib/sapphire/DSL/Comparisons/SelectedComparison.rb +17 -0
- data/lib/sapphire/DSL/Comparisons/StartsWithComparison.rb +17 -0
- data/lib/sapphire/DSL/Comparisons/VisibleComparison.rb +17 -0
- data/lib/sapphire/DSL/Configuration/Use.rb +3 -0
- data/lib/sapphire/DSL/Data/GetPageField.rb +4 -8
- data/lib/sapphire/DSL/Evaluations/Evaluation.rb +46 -0
- data/lib/sapphire/DSL/Evaluations/FieldNotDefinedEvaluation.rb +21 -0
- data/lib/sapphire/DSL/Evaluations/FieldNotFoundEvaluation.rb +21 -0
- data/lib/sapphire/DSL/Evaluators/AltText.rb +17 -0
- data/lib/sapphire/DSL/Evaluators/Checked.rb +17 -0
- data/lib/sapphire/DSL/Evaluators/Contain.rb +10 -0
- data/lib/sapphire/DSL/Evaluators/Count.rb +9 -0
- data/lib/sapphire/DSL/Evaluators/Differ.rb +10 -0
- data/lib/sapphire/DSL/Evaluators/Evaluator.rb +22 -0
- data/lib/sapphire/DSL/Evaluators/Exist.rb +9 -0
- data/lib/sapphire/DSL/Evaluators/In.rb +10 -0
- data/lib/sapphire/DSL/Evaluators/Selected.rb +10 -0
- data/lib/sapphire/DSL/Evaluators/Show.rb +10 -0
- data/lib/sapphire/DSL/Evaluators/Source.rb +17 -0
- data/lib/sapphire/DSL/Evaluators/Transition.rb +10 -0
- data/lib/sapphire/DSL/Evaluators/Validate.rb +8 -0
- data/lib/sapphire/DSL/Events/Causes.rb +3 -0
- data/lib/sapphire/DSL/Events/Event.rb +19 -0
- data/lib/sapphire/DSL/Events/Expect.rb +19 -0
- data/lib/sapphire/DSL/Scenarios/then.rb +1 -1
- data/lib/sapphire/DSL/Scenarios/when.rb +1 -1
- data/lib/sapphire/DSL/TestPlans/FileHandler.rb +7 -2
- data/lib/sapphire/DSL/TestPlans/PathHandler.rb +2 -1
- data/lib/sapphire/DataAbstractions/NonQuery.rb +2 -1
- data/lib/sapphire/DataAbstractions/Query.rb +2 -1
- data/lib/sapphire/Extensions.rb +1 -0
- data/lib/sapphire/{DSL/Browser/Extensions → Extensions}/Class.rb +10 -0
- data/lib/sapphire/Extensions/Hash.rb +85 -0
- data/lib/sapphire/{DSL/Browser/Extensions → Extensions}/Numeric.rb +6 -6
- data/lib/sapphire/Extensions/Object.rb +9 -0
- data/lib/sapphire/{DSL/Browser/Extensions → Extensions}/String.rb +4 -0
- data/lib/sapphire/Extensions/Symbol.rb +105 -0
- data/lib/sapphire/Sessions/Parameter.rb +36 -0
- data/lib/sapphire/Sessions/Storage.rb +17 -0
- data/lib/sapphire/UI/Functions.rb +2 -1
- data/lib/sapphire/UI/ProcessBuilder.rb +174 -0
- data/lib/sapphire/Virtualization.rb +1 -1
- data/lib/sapphire/WebAbstractions/Browsers/Chrome.rb +22 -21
- data/lib/sapphire/WebAbstractions/Browsers/FireFox.rb +24 -22
- data/lib/sapphire/WebAbstractions/Browsers/InternetExplorer.rb +22 -21
- data/lib/sapphire/WebAbstractions/Controls/AlertBox.rb +21 -0
- data/lib/sapphire/WebAbstractions/Controls/Base/Control.rb +32 -14
- data/lib/sapphire/WebAbstractions/Controls/Base/Page.rb +74 -65
- data/lib/sapphire/WebAbstractions/Controls/CheckBox.rb +29 -28
- data/lib/sapphire/WebAbstractions/Controls/DropDown.rb +59 -26
- data/lib/sapphire/WebAbstractions/Controls/Image.rb +10 -0
- data/lib/sapphire/WebAbstractions/Controls/List.rb +45 -4
- data/lib/sapphire/WebAbstractions/Controls/RadioButton.rb +29 -18
- data/lib/sapphire/WebAbstractions/Controls/TextBox.rb +9 -8
- data/lib/sapphire/WebAbstractions/Controls/Title.rb +1 -1
- data/lib/sapphire/version.rb +1 -1
- metadata +55 -39
- data/lib/sapphire/Configuration/SapphireConfig.rb +0 -33
- data/lib/sapphire/DSL/Browser/Extensions/Hash.rb +0 -11
- data/lib/sapphire/DSL/Browser/Extensions/Symbol.rb +0 -37
- data/lib/sapphire/DSL/Browser/Not.rb +0 -39
- data/lib/sapphire/DSL/Browser/Nouns/AlertBox.rb +0 -15
- data/lib/sapphire/DSL/Browser/Verbs/Attempt.rb +0 -14
- data/lib/sapphire/DSL/Browser/Verbs/Contain.rb +0 -25
- data/lib/sapphire/DSL/Browser/Verbs/Count.rb +0 -24
- data/lib/sapphire/DSL/Browser/Verbs/Differ.rb +0 -19
- data/lib/sapphire/DSL/Browser/Verbs/Error.rb +0 -25
- data/lib/sapphire/DSL/Browser/Verbs/Hide.rb +0 -25
- data/lib/sapphire/DSL/Browser/Verbs/Show.rb +0 -25
- data/lib/sapphire/DSL/Browser/Verbs/Transition.rb +0 -25
- data/lib/sapphire/DSL/Data/Exist.rb +0 -26
- data/lib/sapphire/DSL/Data/Validate.rb +0 -25
- data/lib/sapphire/Strategies.rb +0 -2
- data/lib/sapphire/Strategies/ClassStrategy.rb +0 -13
- data/lib/sapphire/Strategies/ContainsEvaluation.rb +0 -16
- data/lib/sapphire/Strategies/ContainsNullModifier.rb +0 -34
- data/lib/sapphire/Strategies/DefaultStrategy.rb +0 -17
- data/lib/sapphire/Strategies/Evaluation.rb +0 -16
- data/lib/sapphire/Strategies/HashStrategy.rb +0 -72
- data/lib/sapphire/Strategies/NullModifier.rb +0 -34
- data/lib/sapphire/Strategies/Strategy.rb +0 -11
- data/lib/sapphire/Strategies/SymbolStrategy.rb +0 -59
- data/lib/sapphire/WebAbstractions/Controls/TableCell.rb +0 -10
data/lib/sapphire.rb
CHANGED
@@ -9,10 +9,10 @@ require 'Forwardable'
|
|
9
9
|
require 'colorize'
|
10
10
|
|
11
11
|
require 'sapphire/Adapters'
|
12
|
-
require 'sapphire/Strategies'
|
13
12
|
require 'sapphire/Testing'
|
14
13
|
require 'sapphire/Web'
|
15
14
|
require 'sapphire/DSL'
|
15
|
+
require 'sapphire/Extensions'
|
16
16
|
require 'sapphire/CommandLine'
|
17
17
|
require 'sapphire/Configuration'
|
18
18
|
require 'sapphire/Data'
|
@@ -21,12 +21,13 @@ require 'sapphire/TeamCity'
|
|
21
21
|
|
22
22
|
module Sapphire
|
23
23
|
module Sapphire
|
24
|
-
include DSL
|
24
|
+
include DSL
|
25
25
|
include DSL::Scenarios
|
26
26
|
include DSL::Browser
|
27
27
|
include DSL::Configuration
|
28
28
|
include DSL::Data
|
29
29
|
include DSL::TestPlans
|
30
|
+
include DSL::Events
|
30
31
|
include Configuration::AttrMethods
|
31
32
|
include Configuration
|
32
33
|
include DataAbstractions
|
@@ -33,6 +33,19 @@ module Sapphire
|
|
33
33
|
self.browser.switch_to.window(self.browser.window_handles[0])
|
34
34
|
end
|
35
35
|
|
36
|
+
def FindAlert()
|
37
|
+
begin
|
38
|
+
return self.browser.switch_to.alert
|
39
|
+
rescue
|
40
|
+
return nil
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def AlertShown()
|
45
|
+
alert = self.FindAlert()
|
46
|
+
return alert != nil
|
47
|
+
end
|
48
|
+
|
36
49
|
def ClosePopup
|
37
50
|
self.browser.switch_to.window(self.browser.window_handles.last)
|
38
51
|
self.browser.close
|
@@ -58,14 +71,13 @@ module Sapphire
|
|
58
71
|
|
59
72
|
def NavigateTo(page)
|
60
73
|
if(page.is_a? Class)
|
61
|
-
|
74
|
+
$page = page.new
|
62
75
|
else
|
63
|
-
|
76
|
+
$page = page
|
64
77
|
end
|
65
78
|
|
66
|
-
self.browser.get
|
67
|
-
|
68
|
-
nav
|
79
|
+
self.browser.get $page.Url
|
80
|
+
$page.Init
|
69
81
|
end
|
70
82
|
|
71
83
|
def CurrentUrl
|
@@ -81,33 +93,38 @@ module Sapphire
|
|
81
93
|
self.browser.get self.CurrentUrl
|
82
94
|
end
|
83
95
|
|
84
|
-
def ShouldNavigateTo(page)
|
96
|
+
def ShouldNavigateTo(page, comparator)
|
85
97
|
if(page.is_a? Class)
|
86
|
-
|
98
|
+
$page = page.new
|
87
99
|
else
|
88
|
-
|
100
|
+
$page = page
|
89
101
|
end
|
90
102
|
|
103
|
+
$page.Init
|
104
|
+
|
91
105
|
wait = Selenium::WebDriver::Wait.new(:timeout => 20)
|
92
106
|
begin
|
93
|
-
|
94
|
-
x = self.CurrentUrl.upcase.start_with?(
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
107
|
+
item = wait.until {
|
108
|
+
x = self.CurrentUrl.upcase.start_with?($page.Url.upcase)
|
109
|
+
y = StartsWithComparison.new(Evaluation.new(self.CurrentUrl.upcase, $page.Url.upcase))
|
110
|
+
if(comparator.Compare(x == false, true))
|
111
|
+
$page.AlternateUrls.each do |url|
|
112
|
+
if(comparator.Compare(x == false, true))
|
113
|
+
x = self.CurrentUrl.upcase.start_with?(url.upcase)
|
114
|
+
y = StartsWithComparison.new(Evaluation.new(self.CurrentUrl.upcase, url.upcase))
|
99
115
|
end
|
100
116
|
end
|
101
117
|
end
|
102
|
-
|
118
|
+
|
119
|
+
return y if comparator.Compare(x == true, true)
|
103
120
|
}
|
104
121
|
rescue
|
105
|
-
temp = Evaluation.new(self.CurrentUrl,
|
106
|
-
return temp
|
122
|
+
temp = StartsWithComparison.new(Evaluation.new(self.CurrentUrl, $page.Url))
|
123
|
+
return temp
|
107
124
|
end
|
108
125
|
|
109
|
-
temp =
|
110
|
-
return temp
|
126
|
+
temp = item
|
127
|
+
return temp
|
111
128
|
end
|
112
129
|
|
113
130
|
def Run(background)
|
@@ -115,24 +132,20 @@ module Sapphire
|
|
115
132
|
scenario.Run
|
116
133
|
end
|
117
134
|
|
118
|
-
def
|
119
|
-
self.ShouldNavigateTo page
|
120
|
-
end
|
121
|
-
|
122
|
-
def ShouldTransitionTo(url)
|
135
|
+
def ShouldTransitionTo(url, comparator)
|
123
136
|
if(url.instance_of?(String))
|
124
|
-
temp =
|
137
|
+
temp = StartsWithComparison.new(Evaluation.new(self.CurrentUrl.upcase, url.upcase))
|
125
138
|
@rootUrl = url
|
126
139
|
else
|
127
140
|
x = url.new().Url
|
128
|
-
temp =
|
141
|
+
temp = StartsWithComparison.new(Evaluation.new(self.CurrentUrl.upcase, x.upcase))
|
129
142
|
@rootUrl = x
|
130
143
|
end
|
131
144
|
|
132
145
|
return temp
|
133
146
|
end
|
134
147
|
|
135
|
-
def FindItem(array)
|
148
|
+
def FindItem(array, comparator = nil)
|
136
149
|
masterWait = Selenium::WebDriver::Wait.new(:timeout => 5)
|
137
150
|
|
138
151
|
element = masterWait.until {
|
@@ -150,13 +163,16 @@ module Sapphire
|
|
150
163
|
x = self.FindElement item[0], item[1] if item.is_a? Array
|
151
164
|
|
152
165
|
return x if x != nil
|
166
|
+
return x if comparator.Compare(x != nil, true) if comparator != nil
|
153
167
|
|
154
168
|
end if array.is_a? Array
|
155
169
|
|
156
170
|
x = self.FindElement array.keys.first, array.fetch(array.keys.first) if array.is_a? Hash
|
157
171
|
return x if x != nil
|
172
|
+
return x if comparator.Compare(x != nil, true) if comparator != nil
|
158
173
|
}
|
159
174
|
return element if element != nil
|
175
|
+
return element if comparator.Compare(element != nil, true) if comparator != nil
|
160
176
|
raise "Could not find control for array: " + array.to_s
|
161
177
|
end
|
162
178
|
|
data/lib/sapphire/DSL.rb
CHANGED
@@ -1,10 +1,15 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) +'/DSL/Evaluators/Evaluator.rb', __FILE__)
|
2
|
+
require File.expand_path(File.dirname(__FILE__) +'/DSL/Comparisons/Comparison.rb', __FILE__)
|
3
|
+
Dir[File.dirname(__FILE__) + '/DSL/Evaluators/*.rb'].each {|file| require file }
|
4
|
+
Dir[File.dirname(__FILE__) + '/DSL/Comparisons/*.rb'].each {|file| require file }
|
5
|
+
Dir[File.dirname(__FILE__) + '/DSL/Evaluations/*.rb'].each {|file| require file }
|
1
6
|
Dir[File.dirname(__FILE__) + '/DSL/TestPlans/*.rb'].each {|file| require file }
|
2
7
|
Dir[File.dirname(__FILE__) + '/DSL/Browser/*.rb'].each {|file| require file }
|
3
8
|
Dir[File.dirname(__FILE__) + '/DSL/Browser/Fluff/*.rb'].each {|file| require file }
|
4
|
-
Dir[File.dirname(__FILE__) + '/DSL/Browser/Extensions/*.rb'].each {|file| require file }
|
5
9
|
Dir[File.dirname(__FILE__) + '/DSL/Browser/Nouns/*.rb'].each {|file| require file }
|
6
10
|
Dir[File.dirname(__FILE__) + '/DSL/Browser/Verbs/*.rb'].each {|file| require file }
|
7
11
|
Dir[File.dirname(__FILE__) + '/DSL/Browser/Keys/*.rb'].each {|file| require file }
|
8
12
|
Dir[File.dirname(__FILE__) + '/DSL/Configuration/*.rb'].each {|file| require file }
|
9
13
|
Dir[File.dirname(__FILE__) + '/DSL/Data/*.rb'].each {|file| require file }
|
10
14
|
Dir[File.dirname(__FILE__) + '/DSL/Scenarios/*.rb'].each {|file| require file }
|
15
|
+
Dir[File.dirname(__FILE__) + '/DSL/Events/*.rb'].each {|file| require file }
|
@@ -1,32 +1,18 @@
|
|
1
1
|
module Sapphire
|
2
2
|
module DSL
|
3
3
|
module Browser
|
4
|
-
def ExecuteHashAgainstControl(hash,
|
4
|
+
def ExecuteHashAgainstControl(hash, &block)
|
5
5
|
hash.keys.each do |key|
|
6
|
-
page.
|
7
|
-
field.keys.each do |field_key|
|
8
|
-
if(field_key == key)
|
9
|
-
block.call(field[field_key], hash[key])
|
10
|
-
return
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
6
|
+
return block.call($page.Get(key), hash[key]) if($page.Contains key)
|
14
7
|
end
|
15
8
|
|
16
|
-
raise "
|
9
|
+
raise "Cannot find control matching " + hash.to_s + " for page " + $page.to_s
|
17
10
|
end
|
18
11
|
|
19
|
-
def ExecuteAgainstControl(item,
|
20
|
-
page.
|
21
|
-
field.keys.each do |field_key|
|
22
|
-
if(field_key == item)
|
23
|
-
block.call(field[field_key], item)
|
24
|
-
return
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
12
|
+
def ExecuteAgainstControl(item, &block)
|
13
|
+
return block.call($page.Get(item), item) if($page.Contains item)
|
28
14
|
|
29
|
-
raise "Cannot find controls matching: " + item + "for page " +
|
15
|
+
raise "Cannot find controls matching: " + item.to_s + "for page " + $page.to_s
|
30
16
|
end
|
31
17
|
end
|
32
18
|
end
|
@@ -1,10 +1,9 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Browser
|
4
|
-
def For(item)
|
5
|
-
|
6
|
-
end
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Browser
|
4
|
+
def For(item)
|
5
|
+
{item => GetPageField(item).Text}
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
@@ -1,24 +1,42 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Browser
|
4
|
-
def Day(value
|
5
|
-
Day.new(value, compare1, compare2)
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Browser
|
4
|
+
def Day(value)
|
5
|
+
day = Day.new(value, $compare1, $compare2)
|
6
|
+
$compare1 = nil
|
7
|
+
$compare2 = nil
|
8
|
+
return day
|
9
|
+
end
|
10
|
+
|
11
|
+
class Day
|
12
|
+
|
13
|
+
def initialize(value, compare1, compare2)
|
14
|
+
@value = value
|
15
|
+
if(compare1.is_a?(String))
|
16
|
+
@compare1 = Date.parse(compare1)
|
17
|
+
else
|
18
|
+
@compare1 = compare1
|
19
|
+
end
|
20
|
+
|
21
|
+
if(compare2.is_a?(String))
|
22
|
+
@compare2 = Date.parse(compare2)
|
23
|
+
else
|
24
|
+
@compare2 = compare2
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def Differ(comparator)
|
29
|
+
return Fix(DifferComparison.new(Evaluation.new(@compare1 + @value, @compare2)), comparator)
|
30
|
+
end
|
31
|
+
|
32
|
+
def Fix(evaluation, comparator)
|
33
|
+
comparator = comparator.Create(evaluation)
|
34
|
+
|
35
|
+
comparator
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
@@ -1,24 +1,42 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Browser
|
4
|
-
def Month(value
|
5
|
-
Month.new(value, compare1, compare2)
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Browser
|
4
|
+
def Month(value)
|
5
|
+
month = Month.new(value, $compare1, $compare2)
|
6
|
+
$compare1 = nil
|
7
|
+
$compare2 = nil
|
8
|
+
return month
|
9
|
+
end
|
10
|
+
|
11
|
+
class Month
|
12
|
+
|
13
|
+
def initialize(value, compare1, compare2)
|
14
|
+
@value = value
|
15
|
+
if(compare1.is_a?(String))
|
16
|
+
@compare1 = Date.parse(compare1)
|
17
|
+
else
|
18
|
+
@compare1 = compare1
|
19
|
+
end
|
20
|
+
|
21
|
+
if(compare2.is_a?(String))
|
22
|
+
@compare2 = Date.parse(compare2)
|
23
|
+
else
|
24
|
+
@compare2 = compare2
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def Differ(comparator)
|
29
|
+
return Fix(DifferComparison.new(Evaluation.new(@compare1 >> @value, @compare2)), comparator)
|
30
|
+
end
|
31
|
+
|
32
|
+
def Fix(evaluation, comparator)
|
33
|
+
comparator = comparator.Create(evaluation)
|
34
|
+
|
35
|
+
comparator
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|