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

not working with riot correctly? #80

Closed
thepixelmonk opened this issue Sep 18, 2011 · 8 comments
Closed

not working with riot correctly? #80

thepixelmonk opened this issue Sep 18, 2011 · 8 comments
Labels

Comments

@thepixelmonk
Copy link

simplecov results: http://stuff.saikonet.org/images/misc/2011-09-18-150129_1024x768_scrot.png

my tests:

context 'New user visits web site' do
    base_uri 'http://localhost:3001'
    get '/'
    asserts_status.equals(200)
end
context 'Authentication' do
    context 'User signs up' do
      base_uri 'http://localhost:3001'
      post '/site/authenticate', body: { user: { email: 'saiko_chriskun@shortmail.com', password: 'my_pass' } }
      asserts_status.equals(200)
      asserts('display tasks') { response.body.match(/New Task/) != nil }
    end

    context 'User signs in' do
       base_uri 'http://localhost:3001'
       post '/site/authenticate', body: { user: { email: 'saiko_chriskun@shortmail.com', password: 'my_pass' } }
       asserts_status.equals(200)
       asserts('display tasks') { response.body.match(/New Task/) != nil }
     end
    context 'User tries to signup with existing email' do
       base_uri 'http://localhost:3001'
       post '/site/authenticate', body: { user: { email: 'saiko_chriskun@shortmail.com', password: 'incorrect_pass' } }
       asserts_status.equals(200)
       asserts('display flash message') { response.body.match(/taken!/) != nil }
     end
end
@colszowka
Copy link
Collaborator

I haven't tried SimpleCov with riot yet, but there's no reason it shouldn't work. I'll try it out. Maybe this is related to the bug in the Coverage lib as figured out in #60.

@thepixelmonk
Copy link
Author

yeah I think it's the Coverage lib as cover_me is churning out the same results :P

@colszowka
Copy link
Collaborator

@saiko-chriskun Could you please edit your issue description to hold the code sample you had posted on StackOverflow as it seems the question is no longer present there and I wanted to provide Ruby core maintainers with this example on my already filed bug report on this: http://redmine.ruby-lang.org/issues/5333

@thepixelmonk
Copy link
Author

updated

@thepixelmonk
Copy link
Author

not sure what changed exactly but it's not catching any of my controller code now (it doesn't detect any files under the controller tab) although the models seem to be fine.

@colszowka
Copy link
Collaborator

Thanks for the report. I'm not using riot so I didn't realize the problem yet.

It would be great if you could create a cucumber feature and example that tests usage with the riot framework similar to those already existing and submit it as a Pull Request so I could go about fixing those.

Also, this might be related to #60.

@ghost
Copy link

ghost commented Feb 13, 2012

I'm not having any trouble using it with Riot... Although, I was.

I'm trying to remember how I fixed it. I think what I actually ended up with was this: https://gist.github.com/1814276

Again, I'm fuzzy on the whole "fix". But I think it's the rand(99999) part that is the key. Somehow it allows the results to accumulate, otherwise each set of tests overwrites the previous set of results. Using a random name prevents the overwriting. (Well it actually just makes the odds 1:99999.) What you're probably encountering is your model tests being run after your controller tests, so the controller test coverage results get overwritten.

And yeah I'm pretty sure it's related to #60

@bf4
Copy link
Collaborator

bf4 commented May 17, 2015

Closing as stale. Please reopen if this is still an issue. (And take a look at #340 )

@bf4 bf4 closed this as completed May 17, 2015
@simplecov-ruby simplecov-ruby locked and limited conversation to collaborators May 17, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants