sapphire 0.7.26 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sapphire.rb +51 -40
- data/lib/sapphire/Adapters/Selenium/RubySeleniumWebDriver.rb +24 -68
- data/lib/sapphire/DSL.rb +18 -16
- data/lib/sapphire/DSL/Browser/Create.rb +10 -10
- data/lib/sapphire/DSL/Browser/ExecuteAgainstControl.rb +20 -20
- data/lib/sapphire/DSL/Browser/Fluff/By.rb +10 -10
- data/lib/sapphire/DSL/Browser/Fluff/To.rb +10 -10
- data/lib/sapphire/DSL/Browser/Fluff/With.rb +10 -10
- data/lib/sapphire/DSL/Browser/Nouns/Browser.rb +17 -17
- data/lib/sapphire/DSL/Browser/Nouns/Enter.rb +10 -10
- data/lib/sapphire/DSL/Browser/Tracker.rb +15 -15
- data/lib/sapphire/DSL/Browser/Verbs/Accept.rb +8 -8
- data/lib/sapphire/DSL/Browser/Verbs/Check.rb +10 -10
- data/lib/sapphire/DSL/Browser/Verbs/Clear.rb +8 -8
- data/lib/sapphire/DSL/Browser/Verbs/Click.rb +10 -10
- data/lib/sapphire/DSL/Browser/Verbs/Compare.rb +18 -18
- data/lib/sapphire/DSL/Browser/Verbs/Complete.rb +13 -13
- data/lib/sapphire/DSL/Browser/Verbs/Exists.rb +16 -16
- data/lib/sapphire/DSL/Browser/Verbs/Exit.rb +11 -11
- data/lib/sapphire/DSL/Browser/Verbs/MouseOver.rb +10 -10
- data/lib/sapphire/DSL/Browser/Verbs/Navigate.rb +10 -10
- data/lib/sapphire/DSL/Browser/Verbs/Press.rb +8 -8
- data/lib/sapphire/DSL/Browser/Verbs/Reload.rb +11 -11
- data/lib/sapphire/DSL/Browser/Verbs/Set.rb +10 -10
- data/lib/sapphire/DSL/Browser/Verbs/Uncheck.rb +10 -10
- data/lib/sapphire/DSL/Comparisons/CheckedComparison.rb +17 -17
- data/lib/sapphire/DSL/Comparisons/Comparison.rb +50 -50
- data/lib/sapphire/DSL/Comparisons/ContainsComparison.rb +17 -17
- data/lib/sapphire/DSL/Comparisons/DifferComparison.rb +17 -17
- data/lib/sapphire/DSL/Comparisons/EqualsComparison.rb +16 -16
- data/lib/sapphire/DSL/Comparisons/NotComparison.rb +20 -20
- data/lib/sapphire/DSL/Comparisons/SelectedComparison.rb +17 -17
- data/lib/sapphire/DSL/Comparisons/StartsWithComparison.rb +17 -17
- data/lib/sapphire/DSL/Comparisons/VisibleComparison.rb +17 -17
- data/lib/sapphire/DSL/Configuration/ConfiguredBrowser.rb +12 -12
- data/lib/sapphire/DSL/Configuration/ConfiguredUser.rb +10 -10
- data/lib/sapphire/DSL/Configuration/Use.rb +18 -18
- data/lib/sapphire/DSL/Data/Find.rb +10 -10
- data/lib/sapphire/DSL/Data/GetPageField.rb +13 -13
- data/lib/sapphire/DSL/Data/Verify.rb +10 -10
- data/lib/sapphire/DSL/Evaluations/ControlEvaluation.rb +13 -0
- data/lib/sapphire/DSL/Evaluations/Evaluation.rb +55 -45
- data/lib/sapphire/DSL/Evaluations/FieldNotDefinedEvaluation.rb +20 -20
- data/lib/sapphire/DSL/Evaluations/FieldNotFoundEvaluation.rb +22 -22
- data/lib/sapphire/DSL/Evaluators/Contain.rb +10 -10
- data/lib/sapphire/DSL/Evaluators/Count.rb +8 -8
- data/lib/sapphire/DSL/Evaluators/Differ.rb +10 -10
- data/lib/sapphire/DSL/Evaluators/Exist.rb +9 -9
- data/lib/sapphire/DSL/Evaluators/In.rb +10 -10
- data/lib/sapphire/DSL/Evaluators/Selected.rb +10 -10
- data/lib/sapphire/DSL/Evaluators/Show.rb +10 -10
- data/lib/sapphire/DSL/Evaluators/Transition.rb +10 -10
- data/lib/sapphire/DSL/Evaluators/Validate.rb +8 -8
- data/lib/sapphire/DSL/Events/Data.rb +12 -0
- data/lib/sapphire/DSL/Events/DataSegment.rb +18 -0
- data/lib/sapphire/DSL/Events/Event.rb +11 -3
- data/lib/sapphire/DSL/Events/Expect.rb +3 -11
- data/lib/sapphire/DSL/Events/Expectation.rb +14 -0
- data/lib/sapphire/DSL/Events/For.rb +11 -0
- data/lib/sapphire/DSL/Events/From.rb +9 -0
- data/lib/sapphire/DSL/Events/Where.rb +11 -0
- data/lib/sapphire/DSL/Profiles/Profile.rb +26 -0
- data/lib/sapphire/DSL/Profiles/Table.rb +9 -0
- data/lib/sapphire/DSL/Scenarios/Is.rb +9 -9
- data/lib/sapphire/DSL/Scenarios/Pending.rb +28 -28
- data/lib/sapphire/DSL/Scenarios/and.rb +25 -25
- data/lib/sapphire/DSL/Scenarios/dsl.rb +59 -59
- data/lib/sapphire/DSL/Scenarios/runner.rb +40 -40
- data/lib/sapphire/Data.rb +1 -1
- data/lib/sapphire/DataAbstractions/Database.rb +57 -57
- data/lib/sapphire/DataAbstractions/Query.rb +20 -20
- data/lib/sapphire/Extensions/Class.rb +2 -2
- data/lib/sapphire/Extensions/Hash.rb +112 -112
- data/lib/sapphire/Extensions/Module.rb +11 -0
- data/lib/sapphire/Extensions/Numeric.rb +6 -6
- data/lib/sapphire/Extensions/Object.rb +4 -0
- data/lib/sapphire/Extensions/String.rb +30 -23
- data/lib/sapphire/Extensions/Symbol.rb +1 -1
- data/lib/sapphire/JobAbstractions/Job.rb +32 -32
- data/lib/sapphire/Observable.rb +87 -0
- data/lib/sapphire/Observers.rb +2 -0
- data/lib/sapphire/Observers/FailedControlHighlighter.rb +41 -0
- data/lib/sapphire/Observers/Highlighter.rb +40 -0
- data/lib/sapphire/Observers/Observer.rb +23 -0
- data/lib/sapphire/Observers/ObserverRepository.rb +37 -0
- data/lib/sapphire/Observers/PassedControlHighlighter.rb +42 -0
- data/lib/sapphire/Observers/VerboseObserver.rb +36 -0
- data/lib/sapphire/TeamCity.rb +10 -10
- data/lib/sapphire/Testing.rb +3 -3
- data/lib/sapphire/Testing/RakeTask.rb +108 -108
- data/lib/sapphire/Testing/ResultList.rb +18 -18
- data/lib/sapphire/Testing/ScenarioResult.rb +36 -36
- data/lib/sapphire/Testing/TestResult.rb +21 -21
- data/lib/sapphire/Testing/TestRunnerAdapter.rb +85 -85
- data/lib/sapphire/UI/ProcessBuilder.rb +173 -173
- data/lib/sapphire/Virtualization.rb +7 -7
- data/lib/sapphire/Web.rb +2 -2
- data/lib/sapphire/WebAbstractions/Controls/AlertBox.rb +20 -20
- data/lib/sapphire/WebAbstractions/Controls/Base/Control.rb +43 -26
- data/lib/sapphire/WebAbstractions/Controls/Button.rb +7 -7
- data/lib/sapphire/WebAbstractions/Controls/CheckBox.rb +3 -3
- data/lib/sapphire/WebAbstractions/Controls/Date.rb +11 -11
- data/lib/sapphire/WebAbstractions/Controls/DropDown.rb +6 -8
- data/lib/sapphire/WebAbstractions/Controls/Hyperlink.rb +8 -8
- data/lib/sapphire/WebAbstractions/Controls/Image.rb +19 -19
- data/lib/sapphire/WebAbstractions/Controls/Label.rb +8 -8
- data/lib/sapphire/WebAbstractions/Controls/List.rb +16 -16
- data/lib/sapphire/WebAbstractions/Controls/RadioButton.rb +2 -2
- data/lib/sapphire/WebAbstractions/Controls/Title.rb +12 -12
- data/lib/sapphire/version.rb +1 -1
- metadata +26 -8
@@ -1,17 +1,17 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
class ContainsComparison < Comparison
|
4
|
-
|
5
|
-
def Compare(left, right)
|
6
|
-
return @comparator.Compare((right.include? left), true) if @comparator != nil
|
7
|
-
right.include? left
|
8
|
-
end
|
9
|
-
|
10
|
-
def Text
|
11
|
-
return @comparator.Text + " to contain" if @comparator != nil
|
12
|
-
" to contain"
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
class ContainsComparison < Comparison
|
4
|
+
|
5
|
+
def Compare(left, right)
|
6
|
+
return @comparator.Compare((right.include? left), true) if @comparator != nil
|
7
|
+
right.include? left
|
8
|
+
end
|
9
|
+
|
10
|
+
def Text
|
11
|
+
return @comparator.Text + " to contain" if @comparator != nil
|
12
|
+
" to contain"
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -1,17 +1,17 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
class DifferComparison < Comparison
|
4
|
-
|
5
|
-
def Compare(left, right)
|
6
|
-
return @comparator.Compare((right == left), true) if @comparator != nil
|
7
|
-
right == left
|
8
|
-
end
|
9
|
-
|
10
|
-
def Text
|
11
|
-
return @comparator.Text + "" if @comparator != nil
|
12
|
-
""
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
class DifferComparison < Comparison
|
4
|
+
|
5
|
+
def Compare(left, right)
|
6
|
+
return @comparator.Compare((right == left), true) if @comparator != nil
|
7
|
+
right == left
|
8
|
+
end
|
9
|
+
|
10
|
+
def Text
|
11
|
+
return @comparator.Text + "" if @comparator != nil
|
12
|
+
""
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -1,16 +1,16 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
class EqualsComparison < Comparison
|
4
|
-
|
5
|
-
def Compare(left, right)
|
6
|
-
return @comparator.Compare(left == right, true) if @comparator != nil
|
7
|
-
left == right
|
8
|
-
end
|
9
|
-
|
10
|
-
def Text
|
11
|
-
""
|
12
|
-
end
|
13
|
-
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
class EqualsComparison < Comparison
|
4
|
+
|
5
|
+
def Compare(left, right)
|
6
|
+
return @comparator.Compare(left == right, true) if @comparator != nil
|
7
|
+
left == right
|
8
|
+
end
|
9
|
+
|
10
|
+
def Text
|
11
|
+
""
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -1,21 +1,21 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
def Not(item)
|
4
|
-
NotComparison.new(item)
|
5
|
-
end
|
6
|
-
|
7
|
-
class NotComparison < Comparison
|
8
|
-
|
9
|
-
def Compare(left, right)
|
10
|
-
return @comparator.Compare(left != right, true) if @comparator != nil
|
11
|
-
left != right
|
12
|
-
end
|
13
|
-
|
14
|
-
def Text
|
15
|
-
return @comparator.Text + " NOT" if @comparator != nil
|
16
|
-
" NOT"
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
20
|
-
end
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
def Not(item)
|
4
|
+
NotComparison.new(item)
|
5
|
+
end
|
6
|
+
|
7
|
+
class NotComparison < Comparison
|
8
|
+
|
9
|
+
def Compare(left, right)
|
10
|
+
return @comparator.Compare(left != right, true) if @comparator != nil
|
11
|
+
left != right
|
12
|
+
end
|
13
|
+
|
14
|
+
def Text
|
15
|
+
return @comparator.Text + " NOT" if @comparator != nil
|
16
|
+
" NOT"
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
21
|
end
|
@@ -1,17 +1,17 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
class SelectedComparison < Comparison
|
4
|
-
|
5
|
-
def Compare(left, right)
|
6
|
-
return @comparator.Compare(left.Selected, true) if @comparator != nil
|
7
|
-
left.Selected
|
8
|
-
end
|
9
|
-
|
10
|
-
def Text
|
11
|
-
return @comparator.Text + " to be selected" if @comparator != nil
|
12
|
-
" to be selected"
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
class SelectedComparison < Comparison
|
4
|
+
|
5
|
+
def Compare(left, right)
|
6
|
+
return @comparator.Compare(left.Selected, true) if @comparator != nil
|
7
|
+
left.Selected
|
8
|
+
end
|
9
|
+
|
10
|
+
def Text
|
11
|
+
return @comparator.Text + " to be selected" if @comparator != nil
|
12
|
+
" to be selected"
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -1,17 +1,17 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
class StartsWithComparison < Comparison
|
4
|
-
|
5
|
-
def Compare(left, right)
|
6
|
-
return @comparator.Compare((left.start_with? right), true) if @comparator != nil
|
7
|
-
left.start_with? right
|
8
|
-
end
|
9
|
-
|
10
|
-
def Text
|
11
|
-
return @comparator.Text if @comparator != nil
|
12
|
-
""
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
class StartsWithComparison < Comparison
|
4
|
+
|
5
|
+
def Compare(left, right)
|
6
|
+
return @comparator.Compare((left.start_with? right), true) if @comparator != nil
|
7
|
+
left.start_with? right
|
8
|
+
end
|
9
|
+
|
10
|
+
def Text
|
11
|
+
return @comparator.Text if @comparator != nil
|
12
|
+
""
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -1,17 +1,17 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
class VisibleComparison < Comparison
|
4
|
-
|
5
|
-
def Compare(left, right)
|
6
|
-
return @comparator.Compare(left.Visible, true) if @comparator != nil
|
7
|
-
left.Visible
|
8
|
-
end
|
9
|
-
|
10
|
-
def Text
|
11
|
-
return @comparator.Text + " to be visible" if @comparator != nil
|
12
|
-
" to be visible"
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
class VisibleComparison < Comparison
|
4
|
+
|
5
|
+
def Compare(left, right)
|
6
|
+
return @comparator.Compare(left.Visible, true) if @comparator != nil
|
7
|
+
left.Visible
|
8
|
+
end
|
9
|
+
|
10
|
+
def Text
|
11
|
+
return @comparator.Text + " to be visible" if @comparator != nil
|
12
|
+
" to be visible"
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -1,13 +1,13 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Configuration
|
4
|
-
def ConfiguredBrowser(url)
|
5
|
-
@rootUrl = url
|
6
|
-
ConfigurationBrowser
|
7
|
-
end
|
8
|
-
|
9
|
-
class ConfigurationBrowser
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Configuration
|
4
|
+
def ConfiguredBrowser(url)
|
5
|
+
@rootUrl = url
|
6
|
+
ConfigurationBrowser
|
7
|
+
end
|
8
|
+
|
9
|
+
class ConfigurationBrowser
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
13
|
end
|
@@ -1,11 +1,11 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Configuration
|
4
|
-
def configured_user
|
5
|
-
$user
|
6
|
-
end
|
7
|
-
class ConfiguredUser
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Configuration
|
4
|
+
def configured_user
|
5
|
+
$user
|
6
|
+
end
|
7
|
+
class ConfiguredUser
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
11
|
end
|
@@ -1,18 +1,18 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Configuration
|
4
|
-
def Use(user)
|
5
|
-
if(user == ConfiguredUser)
|
6
|
-
if AppConfig.Current.nil?
|
7
|
-
raise "No App Config defined!"
|
8
|
-
end
|
9
|
-
$user = AppConfig.new().User
|
10
|
-
else
|
11
|
-
$user = user.new
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Configuration
|
4
|
+
def Use(user)
|
5
|
+
if(user == ConfiguredUser)
|
6
|
+
if AppConfig.Current.nil?
|
7
|
+
raise "No App Config defined!"
|
8
|
+
end
|
9
|
+
$user = AppConfig.new().User
|
10
|
+
else
|
11
|
+
$user = user.new
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
|
@@ -1,10 +1,10 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Data
|
4
|
-
def Find(query, &block)
|
5
|
-
query.Execute block
|
6
|
-
end
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Data
|
4
|
+
def Find(query, &block)
|
5
|
+
query.Execute block
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
@@ -1,13 +1,13 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Data
|
4
|
-
def GetPageField(key)
|
5
|
-
|
6
|
-
return $page.Get(key) if $page.Contains key
|
7
|
-
|
8
|
-
raise "Could not find control for: " + key + " for page " + $page.to_s
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Data
|
4
|
+
def GetPageField(key)
|
5
|
+
|
6
|
+
return $page.Get(key) if $page.Contains key
|
7
|
+
|
8
|
+
raise "Could not find control for: " + key + " for page " + $page.to_s
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
@@ -1,10 +1,10 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Data
|
4
|
-
def Verify(instance)
|
5
|
-
instance.Verify
|
6
|
-
end
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Data
|
4
|
+
def Verify(instance)
|
5
|
+
instance.Verify
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
@@ -1,46 +1,56 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
class Evaluation
|
4
|
-
|
5
|
-
attr_accessor :left
|
6
|
-
attr_accessor :right
|
7
|
-
|
8
|
-
def initialize(left, right)
|
9
|
-
@left = left
|
10
|
-
@right = right
|
11
|
-
end
|
12
|
-
|
13
|
-
def Compare(left, right)
|
14
|
-
return @comparator.Compare(left, right) if @comparator != nil
|
15
|
-
EqualsComparison.new(self).Compare(left, right) if @comparator == nil
|
16
|
-
end
|
17
|
-
|
18
|
-
def CompareWith(item)
|
19
|
-
@comparator = item
|
20
|
-
end
|
21
|
-
|
22
|
-
def execute()
|
23
|
-
self.Output()
|
24
|
-
end
|
25
|
-
|
26
|
-
def Evaluate()
|
27
|
-
Compare(@left, @right)
|
28
|
-
end
|
29
|
-
|
30
|
-
def Output()
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
class Evaluation
|
4
|
+
|
5
|
+
attr_accessor :left
|
6
|
+
attr_accessor :right
|
7
|
+
|
8
|
+
def initialize(left, right)
|
9
|
+
@left = left
|
10
|
+
@right = right
|
11
|
+
end
|
12
|
+
|
13
|
+
def Compare(left, right)
|
14
|
+
return @comparator.Compare(left, right) if @comparator != nil
|
15
|
+
EqualsComparison.new(self).Compare(left, right) if @comparator == nil
|
16
|
+
end
|
17
|
+
|
18
|
+
def CompareWith(item)
|
19
|
+
@comparator = item
|
20
|
+
end
|
21
|
+
|
22
|
+
def execute()
|
23
|
+
self.Output()
|
24
|
+
end
|
25
|
+
|
26
|
+
def Evaluate()
|
27
|
+
Compare(@left, @right)
|
28
|
+
end
|
29
|
+
|
30
|
+
def Output()
|
31
|
+
|
32
|
+
if(!Compare(@left, @right))
|
33
|
+
self.Failed(@control)
|
34
|
+
else
|
35
|
+
self.Passed(@control)
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
def Failed(control)
|
41
|
+
messages = []
|
42
|
+
|
43
|
+
messages << "expected" + @comparator.Text + ": (nil)" if @right == nil
|
44
|
+
messages << "expected" + @comparator.Text + ": " + @right.to_s if @right != nil
|
45
|
+
messages << "got: (nil)" if @left == nil
|
46
|
+
messages << "got: " + @left.to_s if @left != nil
|
47
|
+
|
48
|
+
raise ExpectationException.new(messages)
|
49
|
+
end
|
50
|
+
|
51
|
+
def Passed(control)
|
52
|
+
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
46
56
|
end
|