Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class "end" marked as not executed #36

Open
jcowgar opened this issue Apr 2, 2011 · 2 comments
Open

Class "end" marked as not executed #36

jcowgar opened this issue Apr 2, 2011 · 2 comments

Comments

@jcowgar
Copy link

jcowgar commented Apr 2, 2011

1:  class ApplicationController < ActionController::Base 21
2:    protect_from_forgery 21
3:
4:    rescue_from CanCan::AccessDenied do |exception| 8
5:      redirect_to root_path, :alert => t('auth.not_permitted') 5
6:    end 1
7:  end 0

With this being such a small file, it then appears in red as it is reported as 83.3% tested due to the class end not being counted as executed.

@codeodor
Copy link

I'm having the same issue, but not necessarily only on classes. For instance:

if @user.update_attributes(params[:user])
    format.html { redirect_to(@user, :notice => 'User was successfully updated.') }
    format.xml  { head :ok }
  else
    format.html { render :action => "edit" }
    format.xml  { render :xml => @user.errors, :status => :unprocessable_entity }
  end # this line is marked as not having been executed

I just realized that it seemed to go away. I don't think I changed anything in the file, but upon running the tests again (perhaps several times) the coverage has gone up to 100%. I'll try to pay closer attention in the future to see if I can narrow down the cause/fix of the errant behavior.

@ylansegal
Copy link

I guess I am not adding much, but I see the same behavior: lines with only "end" on them and sometimes blank lines being counted as not tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants