Permalink
Browse files

A temp checkin for debugging

  • Loading branch information...
ywen committed Oct 30, 2012
1 parent fbe526c commit ee2ff6a4d351442da0cf35c5c5f9e4d8f0e25e77
Showing with 14 additions and 3 deletions.
  1. +0 −1 bin/spinach
  2. +5 −1 lib/spinach/cli.rb
  3. +1 −1 lib/spinach/config.rb
  4. +8 −0 lib/spinach/runner.rb
View
@@ -12,5 +12,4 @@ rescue LoadError
end
cli = Spinach::Cli.new(ARGV)
-cli.init_reporter
exit cli.run
View
@@ -11,6 +11,7 @@ class Cli
# @api public
def initialize(args = ARGV)
@args = args
+ options # make sure options is parsed
end
# Runs all the features.
@@ -52,13 +53,15 @@ def options
#
# @api private
def parse_options
+ p "enter parse_options"
reporter_options = {}
reporter_options[:backtrace] = false
config = {}
config[:tags] = []
begin
OptionParser.new do |opts|
+ p opts
opts.on('-c', '--config_path PATH',
'Parse options from file (will get overriden by flags)') do |file|
Spinach.config[:config_path] = file
@@ -97,7 +100,8 @@ def parse_options
opts.on('-r', '--reporter CLASS_NAME',
'Formatter class name') do |class_name|
- config[:reporter_class] = Helpers.constantize(class_name)
+ p class_name
+ config[:reporter_class] = class_name
end
end.parse!(@args)
View
@@ -52,7 +52,7 @@ def features_path
#
# @api public
def reporter_class
- @reporter_class || Spinach::Reporter::Stdout
+ @reporter_class || "Spinach::Reporter::Stdout"
end
# The "step definitions path" holds the place where your feature step
View
@@ -46,6 +46,12 @@ def initialize(filenames, options = {})
# The default path where the support files are located
attr_reader :support_path
+ def init_reporter
+ p Helpers.constantize(Spinach.config[:reporter_class])
+ reporter = Helpers.constantize(Spinach.config[:reporter_class]).new({})
+ reporter.bind
+ end
+
# Runs this runner and outputs the results in a colorful manner.
#
# @return [true, false]
@@ -55,11 +61,13 @@ def initialize(filenames, options = {})
def run
require_dependencies
require_frameworks
+ init_reporter
Spinach.hooks.run_before_run
successful = true
+ p filenames
filenames.map do |filename|
filename.split(':')
end.each do |filename, line|

5 comments on commit ee2ff6a

@darrencauthon

This comment has been minimized.

Show comment Hide comment
@darrencauthon

darrencauthon Jan 20, 2015

Is this ok? The "temp" check in is over 2 years old now.

  • Lovingly, ❤️ ❤️ ❤️ a Spinach fan.

Is this ok? The "temp" check in is over 2 years old now.

  • Lovingly, ❤️ ❤️ ❤️ a Spinach fan.
@oriolgual

This comment has been minimized.

Show comment Hide comment
@oriolgual

oriolgual Jan 20, 2015

Owner

Ooops, no this isn't OK I'm afraid!

Owner

oriolgual replied Jan 20, 2015

Ooops, no this isn't OK I'm afraid!

@ywen

This comment has been minimized.

Show comment Hide comment
@ywen

ywen Jan 20, 2015

Collaborator

This is not OK but I believe all these prints have been removed. We could remove this commit if we decide too. Thoughts?

Collaborator

ywen replied Jan 20, 2015

This is not OK but I believe all these prints have been removed. We could remove this commit if we decide too. Thoughts?

@oriolgual

This comment has been minimized.

Show comment Hide comment
@oriolgual

oriolgual Jan 20, 2015

Owner

Oh, I assumed the prints were still there, If they have been removed I'd worry about it.

Owner

oriolgual replied Jan 20, 2015

Oh, I assumed the prints were still there, If they have been removed I'd worry about it.

@darrencauthon

This comment has been minimized.

Show comment Hide comment
@darrencauthon

darrencauthon Jan 20, 2015

Sorry about that... the puts were gone, but the cli.init_reporter call is still out, so it's still the last commit.

The only reason this popped up... I'm putting a presentation on executables in gems, and Spinach was one of my examples (love the simple code). I was looking at a screenshot, and I noticed the "temp" call from two years ago, and I jumped to a conclusion.

No big deal. 😄 Sorry to bother, thanks...

Sorry about that... the puts were gone, but the cli.init_reporter call is still out, so it's still the last commit.

The only reason this popped up... I'm putting a presentation on executables in gems, and Spinach was one of my examples (love the simple code). I was looking at a screenshot, and I noticed the "temp" call from two years ago, and I jumped to a conclusion.

No big deal. 😄 Sorry to bother, thanks...

Please sign in to comment.