distributedlife / cucumber_timing_presenter

Takes the cucumber usage output and presents it in ways that may be useful
MIT License
13 stars 1 forks source link

Uninitialised Constant CucumberTimingPresenter::TimingFormatter::UsageRecord #1

Open stabarinde opened 11 years ago

stabarinde commented 11 years ago

After installing cucumber_timing_presenter with "gem install cucumber_timing_presenter", and attempting to run as per the README ( "cucumber -t @PERF_001 -f CucumberTimingPresenter::TimingFormatter --expand" ) I get the following error;

uninitialized constant CucumberTimingPresenter::TimingFormatter::UsageRecord Error creating formatter: CucumberTimingPresenter::TimingFormatter (NameError) c:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber_timing_presenter-1.0.0.0/lib/cucumber_timing_presenter/timing_formatter.rb:8:ininitialize' c:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.3.1/lib/cucumber/cli/configuration.rb:183:in new' c:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.3.1/lib/cucumber/cli/configuration.rb:183:inblock in formatters' c:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.3.1/lib/cucumber/cli/configuration.rb:178:in map' c:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.3.1/lib/cucumber/cli/configuration.rb:178:informatters' c:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.3.1/lib/cucumber/cli/configuration.rb:76:in build_tree_walker' c:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.3.1/lib/cucumber/runtime.rb:45:inrun!' c:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.3.1/lib/cucumber/cli/main.rb:47:in execute!' c:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.3.1/bin/cucumber:13:in<top (required)>' c:/Ruby193/bin/cucumber:23:in load' c:/Ruby193/bin/cucumber:23:in

'`

My gems are;

*** LOCAL GEMS ***

actionmailer (3.2.8)
actionpack (3.2.8)
activemodel (3.2.8)
activerecord (3.2.8)
activeresource (3.2.8)
activesupport (3.2.8)
addressable (2.3.2)
arel (3.0.2)
bigdecimal (1.1.0)
builder (3.2.0, 3.1.4, 3.0.4)
bundler (1.3.0)
capybara (2.0.3, 1.1.2)
capybara-screenshot (0.2.4)
childprocess (0.3.6)
columnize (0.3.6)
cucumber (1.3.1, 1.2.1)
cucumber_timing_presenter (1.0.0.0)
debugger (1.2.4)
debugger-linecache (1.1.2)
debugger-ruby_core_source (1.1.7)
diff-lcs (1.1.3)
erubis (2.7.0)
extlib (0.9.16)
feed_me (0.7.0)
ffi (1.3.1 x86-mingw32, 1.1.5 x86-mingw32)
gherkin (2.12.0 x86-mingw32, 2.11.5 x86-mingw32)
hike (1.2.1)
i18n (0.6.1)
io-console (0.3)
journey (1.0.4)
json (1.7.6, 1.7.5, 1.5.4)
libwebsocket (0.1.7.1, 0.1.5)
macaddr (1.6.1)
mail (2.4.4)
mime-types (1.19)
minitest (2.5.1)
multi_json (1.7.2, 1.5.0, 1.3.6)
nokogiri (1.5.6 x86-mingw32, 1.5.5 x86-mingw32)
polyglot (0.3.3)
rack (1.4.4, 1.4.1)
rack-cache (1.2)
rack-test (0.6.2)
rake (0.9.2.2)
rasem (0.6.1)
rdoc (3.9.4)
rspec (2.12.0, 2.8.0)
rspec-core (2.12.2, 2.8.0)
rspec-expectations (2.12.1, 2.8.0)
rspec-mocks (2.12.1, 2.8.0)
rubyzip (0.9.9)
selenium-webdriver (2.27.2, 2.25.0)
sprockets (2.1.3)
systemu (2.5.2)
tilt (1.3.3)
treetop (1.4.11)
tzinfo (0.3.33)
uuid (2.3.6)
websocket (1.0.6)
xpath (2.0.0, 1.0.0, 0.1.4) 

Running on windows (but also on linux). cucumber_timing_presenter should be able to see UsageRecord.rb but somehow it cannot.

Any ideas?

Regards,

Dermot

morozgrafix commented 11 years ago

I'm getting the same error. Any update on this?

distributedlife commented 11 years ago

I'll give it a go tomorrow. I don't have access to an appropriate windows install at the moment. @morozgrafix Are you using ruby 1.9.3 as well?

bob-koertge commented 11 years ago

also receiving error: uninitialized constant CucumberTimingPresenter::TimingFormatter::UsageRecord Error creating formatter: CucumberTimingPresenter::TimingFormatter (NameError)

I am on ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.4.2]

gabyshev commented 10 years ago

I am also get the error.

saikrishna321 commented 10 years ago

even i get the same error on mac

uninitialized constant CucumberTimingPresenter::TimingFormatter::UsageRecord Error creating formatter: CucumberTimingPresenter::TimingFormatter (NameError) /Library/Ruby/Gems/2.0.0/gems/cucumber_timing_presenter-1.0.0.0/lib/cucumber_timing_presenter/timing_formatter.rb:8:in initialize' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.15/lib/cucumber/cli/configuration.rb:183:innew' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.15/lib/cucumber/cli/configuration.rb:183:in block in formatters' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.15/lib/cucumber/cli/configuration.rb:178:inmap' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.15/lib/cucumber/cli/configuration.rb:178:in formatters' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.15/lib/cucumber/cli/configuration.rb:76:inbuild_tree_walker' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.15/lib/cucumber/runtime.rb:46:in run!' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.15/lib/cucumber/cli/main.rb:47:inexecute!' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.15/bin/cucumber:13:in <top (required)>' /usr/bin/cucumber:23:inload' /usr/bin/cucumber:23:in <top (required)>' -e:1:inload' -e:1:in `

'

jeffnyman commented 10 years ago

I have yet to see one of these cucumber "formatter" gems actually work right. For the problem mentioned here, you can add relative require statements in timing_formatter.rb:

require_relative 'usage_record'
require_relative 'unused_steps'
require_relative 'all_usage_results_html_presenter'
require_relative 'unused_steps_html_presenter'
require_relative 'step_average_and_total_html_presenter'
require_relative 'step_times_of_whole_html_presenter'

Do note however that you'll also get this:

wrong number of arguments (8 for 7) (ArgumentError)
timing_formatter.rb (line 24)

You have to add one parameter to the after_step_result() method:

def after_step_result(keyword, step_match, multiline_arg, status, exception, source_indent, background, file_colon_line)

Still, though, given the relative requires needed, I would restructure the gem or simply fork a new version. I'm finding I'm going to have to do that with just about every cucumber formatter gem out there. (That said, Cucumber 2.0 is just coming out, so it will be good to make sure no new formatter changes are needed. I think the API is backward compatible with the 1.x branch, but ... you know.)