Skip to content

Commit

Permalink
Signed-off-by: Marcus Bratton <[email protected]>
Browse files Browse the repository at this point in the history
  • Loading branch information
ot-marcus-bratton committed Mar 26, 2012
1 parent f903110 commit b7ecfaf
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 33 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
sapphire (0.7.20)
sapphire (0.7.21)
Platform
colorize
selenium-webdriver
Expand Down
7 changes: 3 additions & 4 deletions bin/sapphire
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ require 'rubygems'
require 'sapphire'
include Sapphire::Sapphire

$console = $stdout
$reporters = []
$instances = []

Expand Down Expand Up @@ -37,9 +38,7 @@ def Process()
$instances.last.file = @file if $instances.last.is_a? HtmlReporter
end

if $instances.empty?
$instances << ConsoleReporter.new()
end
$instances << ConsoleReporter.new()

if Runner.instance.test_plans.count > 0
Report do |x| x.BeginTesting end
Expand Down Expand Up @@ -67,7 +66,7 @@ if @file.nil?
Process()
else
File.open(@file, 'w') do |f|
$stdout = f
$output = f
Process()
end
end
Expand Down
8 changes: 0 additions & 8 deletions lib/sapphire/DSL/TestPlans/TestPlan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,7 @@ def AddHandler(handler)
end

def execute
#Report do |x| x.BeginTesting end
#$stdout.puts ""
#begin
@block.call
#rescue => e
# Report do |x| x.TestFailed TestPlanResult.new('fail', self, e.message, e.backtrace, 0) end
#end
#Report do |x| x.TestingComplete end
#Report do |x| x.OutputResults end
end

def Report(&block)
Expand Down
3 changes: 2 additions & 1 deletion lib/sapphire/Testing/ConsoleReporter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ def initialize
@pending_count = 0
@broken_count = 0
@test_count = 0
@output = $stdout
$console ||= $stdout
@output = $console
end

def ScenarioStart(scenario)
Expand Down
3 changes: 2 additions & 1 deletion lib/sapphire/Testing/HtmlReporter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ def initialize()
@pending_count = 0
@broken_count = 0
@test_count = 0
@output = $stdout
$output ||= $stdout
@output = $output
@file = ""
end

Expand Down
2 changes: 1 addition & 1 deletion lib/sapphire/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Sapphire
VERSION = "0.7.20"
VERSION = "0.7.21"
end
17 changes: 0 additions & 17 deletions tests/BasicPage/TestPlans/NestedTestPlans.rb
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
require File.expand_path('../../includes', File.dirname(__FILE__))

require 'rubygems'
require 'sapphire'
include Sapphire::Sapphire

def Report(&block)
$instances.each do |reporter|
block.call reporter
end
end

if $instances.empty?
$instances << ConsoleReporter.new()
end

Report do |x| x.BeginTesting end

load File.expand_path(File.dirname(__FILE__)) + "/Regression.rb"
load File.expand_path(File.dirname(__FILE__)) + "/Regression.rb"

Report do |x| x.TestingComplete end
Report do |x| x.OutputResults end

0 comments on commit b7ecfaf

Please sign in to comment.