mattwynne / cucover Goto Github PK
View Code? Open in Web Editor NEWLazy coverage-aware running of Cucumber acceptance tests
Home Page: you're looking at it
License: MIT License
Lazy coverage-aware running of Cucumber acceptance tests
Home Page: you're looking at it
License: MIT License
After the workaround described in #1, I ran cucover -s
to see what files Cucover had recorded, so I could see if its change detection was working. But I got an error from -s
:
/Library/Ruby/Gems/1.8/gems/cucover-0.1.4/lib/cucover/store.rb:60:in `load': undefined class/module Test:: (ArgumentError)
from /Library/Ruby/Gems/1.8/gems/cucover-0.1.4/lib/cucover/store.rb:60:in `load'
from /Library/Ruby/Gems/1.8/gems/cucover-0.1.4/lib/cucover/store.rb:60:in `open'
from /Library/Ruby/Gems/1.8/gems/cucover-0.1.4/lib/cucover/store.rb:60:in `load'
from /Library/Ruby/Gems/1.8/gems/cucover-0.1.4/lib/cucover/store.rb:35:in `ensure_recordings_loaded!'
from /Library/Ruby/Gems/1.8/gems/cucover-0.1.4/lib/cucover/store.rb:26:in `recordings'
from /Library/Ruby/Gems/1.8/gems/cucover-0.1.4/lib/cucover/store.rb:8:in `latest_recordings'
from /Library/Ruby/Gems/1.8/gems/cucover-0.1.4/lib/cucover/cli_commands/show_recordings.rb:25:in `recordings'
from /Library/Ruby/Gems/1.8/gems/cucover-0.1.4/lib/cucover/cli_commands/show_recordings.rb:9:in `execute'
from /Library/Ruby/Gems/1.8/gems/cucover-0.1.4/lib/cucover/cli.rb:8:in `start'
from /Library/Ruby/Gems/1.8/gems/cucover-0.1.4/bin/cucover:3
from /usr/bin/cucover:19:in `load'
from /usr/bin/cucover:19
I'm running this under unusual circumstances (Spree, the workaround from #1), but the error happens when unmarshalling the data file, which doesn't sound related.
First off, I'm running Cucover on a Spree project, and a lot of the code is in an extension (like a plugin), not in RAILS_ROOT/app. I don't think that's an issue, but I thought I should mention it.
I get a lot of this error:
undefined method `filename' for nil:NilClass (ActionView::TemplateError)
cucover (0.1.4) lib/cucover/rails.rb:17:in `render'
The line is:
filename = args[0][:file].filename
This seems to work fine for views and layouts rendered by the controller: args[0][:file] is a Template object that knows exactly what file it's rendering.
The problem is when the view in turn renders a partial. In this case, there's no :file, just :partial, and the value isn't a Template, it's just a string like "shared/footer". In some cases, args[0] isn't a hash at all, it's just a string.
I made Cucover get past this line with the following code:
source = args[0]
filename = if source[:file]
source[:file].filename
elsif source[:partial]
source[:partial] =~ /[^\/]+$/
source[:partial].sub(/[^\/]+$/, "_#{$&}")
else
source
end
... but I suspect Cucover won't properly detect when files are changed, because it only has a string like "shared/footer" and not the actual path to the file that was rendered.
One more for you, again perhaps related to #1, but perhaps not.
$ cucover -c vendor/extensions/site/app/controllers/home_controller.rb
features/support/env.rb
/Library/Ruby/Gems/1.8/gems/cucumber-rails-0.3.2/lib/cucumber/rails/action_controller.rb:58: undefined method `Before' for main:Object (NoMethodError)
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `polyglot_original_require'
from /Library/Ruby/Gems/1.8/gems/polyglot-0.3.1/lib/polyglot.rb:64:in `require'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:158:in `require'
from /Library/Ruby/Gems/1.8/gems/cucumber-rails-0.3.2/lib/cucumber/rails/world.rb:27
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `polyglot_original_require'
from /Library/Ruby/Gems/1.8/gems/polyglot-0.3.1/lib/polyglot.rb:64:in `require'
... 8 levels...
from /Library/Ruby/Gems/1.8/gems/cucover-0.1.4/lib/cucover/cli.rb:8:in `start'
from /Library/Ruby/Gems/1.8/gems/cucover-0.1.4/bin/cucover:3
from /usr/bin/cucover:19:in `load'
from /usr/bin/cucover:19
I don't know why cucumber/rails/action_controller.rb expects a Before method to be available, so I don't know why it isn't.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.