Giter VIP home page Giter VIP logo

cucover's People

Contributors

josephwilk avatar mattwynne avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cucover's Issues

undefined class/module Test::

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.

error when Rails view renders a partial

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.

undefined method `Before' for main:Object

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.