sapphire 0.5.7 → 0.5.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -33,6 +33,7 @@ module Sapphire
33
33
  include JobAbstractions
34
34
  include WebAbstractions
35
35
  include Testing
36
+ include Testing::Coverage
36
37
  include Testing::TeamCity
37
38
  include UI
38
39
  end
@@ -2,9 +2,13 @@ module Sapphire
2
2
  module DSL
3
3
  module Browser
4
4
  def Complete(page)
5
- @page = page.Complete
5
+ if(page.is_a? Class)
6
+ temp = page.new
7
+ @page = temp.Complete
8
+ else
9
+ @page = page.Complete
10
+ end
6
11
  end
7
12
  end
8
13
  end
9
- end
10
-
14
+ end
@@ -1,2 +1,3 @@
1
1
  require File.expand_path(File.dirname(__FILE__) +'/Testing/Reporter.rb', __FILE__)
2
2
  Dir[File.dirname(__FILE__) + '/Testing/*.rb'].each {|file| require file }
3
+ Dir[File.dirname(__FILE__) + '/Testing/Coverage/*.rb'].each {|file| require file }
@@ -0,0 +1,28 @@
1
+ module Sapphire
2
+ module Testing
3
+ module Coverage
4
+ def BusinessRule(hash, &block)
5
+ $features.last.AddRule(BusinessRule.new(hash, block))
6
+ end
7
+
8
+ class BusinessRule
9
+
10
+ attr_reader :token
11
+ attr_reader :priority
12
+ attr_reader :tests
13
+
14
+ def initialize(hash, block)
15
+ @token = hash.keys.first
16
+ @priority = hash[hash.keys.first]
17
+ @tests = []
18
+ block.call
19
+ end
20
+
21
+ def AddTest(test)
22
+ @tests << test
23
+ end
24
+
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,9 @@
1
+ module Sapphire
2
+ module Testing
3
+ module Coverage
4
+ def Covers(token)
5
+
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,32 @@
1
+ module Sapphire
2
+ module Testing
3
+ module Coverage
4
+ def Feature(token, &block)
5
+ $features ||= []
6
+ $features << Feature.new(token)
7
+ block.call
8
+ end
9
+
10
+ class Feature
11
+
12
+ attr_reader :business_rules
13
+ attr_reader :token
14
+
15
+ def initialize(token)
16
+ @token = token
17
+ @business_rules = []
18
+ end
19
+
20
+ def AddRule(business_rule)
21
+ @business_rules << business_rule
22
+ end
23
+
24
+ def AddTest(test)
25
+ @business_rules.last().AddTest test
26
+ end
27
+
28
+ end
29
+
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,21 @@
1
+ module Sapphire
2
+ module Testing
3
+ module Coverage
4
+ def Test(token, hash)
5
+ $features.last().AddTest(Test.new(token, hash))
6
+ end
7
+
8
+ class Test
9
+
10
+ attr_reader :token
11
+ attr_reader :type
12
+
13
+ def initialize(token, hash)
14
+ @token = token
15
+ @type = hash[hash.keys.first]
16
+ end
17
+
18
+ end
19
+ end
20
+ end
21
+ end
@@ -1,3 +1,3 @@
1
- module Sapphire
2
- VERSION = "0.5.7"
3
- end
1
+ module Sapphire
2
+ VERSION = "0.5.8"
3
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sapphire
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.7
4
+ version: 0.5.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-11-18 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: selenium-webdriver
16
- requirement: &10059936 !ruby/object:Gem::Requirement
16
+ requirement: &10100448 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *10059936
24
+ version_requirements: *10100448
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: colorize
27
- requirement: &10059684 !ruby/object:Gem::Requirement
27
+ requirement: &10100196 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *10059684
35
+ version_requirements: *10100196
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: Platform
38
- requirement: &10059432 !ruby/object:Gem::Requirement
38
+ requirement: &10099944 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *10059432
46
+ version_requirements: *10099944
47
47
  description: An automated web acceptance test framework for non-technical resources
48
48
  using selenium-wedriver.
49
49
  email:
@@ -146,6 +146,10 @@ files:
146
146
  - lib/sapphire/TeamCity/TeamCityReporter.rb
147
147
  - lib/sapphire/TeamCity.rb
148
148
  - lib/sapphire/Testing/ConsoleReporter.rb
149
+ - lib/sapphire/Testing/Coverage/BusinessRule.rb
150
+ - lib/sapphire/Testing/Coverage/Covers.rb
151
+ - lib/sapphire/Testing/Coverage/Feature.rb
152
+ - lib/sapphire/Testing/Coverage/Test.rb
149
153
  - lib/sapphire/Testing/Executable.rb
150
154
  - lib/sapphire/Testing/ExpectationException.rb
151
155
  - lib/sapphire/Testing/HtmlReporter.rb