Skip to content

Commit

Permalink
A temp checkin for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
ywen committed Oct 30, 2012
1 parent fbe526c commit ee2ff6a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
1 change: 0 additions & 1 deletion bin/spinach
Expand Up @@ -12,5 +12,4 @@ rescue LoadError
end

cli = Spinach::Cli.new(ARGV)
cli.init_reporter
exit cli.run
6 changes: 5 additions & 1 deletion lib/spinach/cli.rb
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion lib/spinach/config.rb
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions lib/spinach/runner.rb
Expand Up @@ -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]
Expand All @@ -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|
Expand Down

5 comments on commit ee2ff6a

@darrencauthon
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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

@oriolgual
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@ywen
Copy link
Collaborator Author

@ywen ywen commented on ee2ff6a Jan 20, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@oriolgual
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@darrencauthon
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.