NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

focused test execution for shoulda
Goto page 1, 2  Next
 
Post new topic   Reply to topic    NetBeans Forums -> Ruby Users
View previous topic :: View next topic  
Author Message
Michael Kovacs
Posted via mailing list.





PostPosted: Thu Jan 15, 2009 10:03 pm    Post subject: focused test execution for shoulda Reply with quote

Hi there fellow ruby netbeans enthusiasts,

I've been holding out moving to a BDD framework for quite sometime for a couple of reasons but one of the biggest ones was the ability to run and debug focused tests easily (I know you've been able to do this with RSpec for quite some time but I don't want to use RSpec for a couple of reasons).


Well now I've decided to take the plunge and start testing with shoulda and having to move back to running entire test files just sorta sucks Smile I'm wondering if there's anything in the works to create a plugin or otherwise modify netbeans to be able to run focused shoulda tests. I see that it can run focused rspec tests so I wouldn't think it would be very hard to modify netbeans to be able to work with shoulda. Heck if someone points me to the right code and how to build it I'd take a look at making it work myself.


Thanks,
-Michael


http://javathehutt.blogspot.com
Back to top
Erno Mononen
Posted via mailing list.





PostPosted: Fri Jan 16, 2009 7:23 am    Post subject: focused test execution for shoulda Reply with quote

Hi Michael,

Michael Kovacs wrote:
Quote:
Hi there fellow ruby netbeans enthusiasts,

I've been holding out moving to a BDD framework for quite sometime for
a couple of reasons but one of the biggest ones was the ability to run
and debug focused tests easily (I know you've been able to do this
with RSpec for quite some time but I don't want to use RSpec for a
couple of reasons).

Well now I've decided to take the plunge and start testing with
shoulda and having to move back to running entire test files just
sorta sucks Smile I'm wondering if there's anything in the works to
create a plugin or otherwise modify netbeans to be able to run focused
shoulda tests. I see that it can run focused rspec tests so I wouldn't
think it would be very hard to modify netbeans to be able to work with
shoulda. Heck if someone points me to the right code and how to build
it I'd take a look at making it work myself.

Actually I've implemented it just yesterday, so it should work in the
latest continuous builds
(http://wiki.netbeans.org/RubyInstallation#section-RubyInstallation-HowDoIGetTheContinuousBuilds).
If you give it a try, let us know if run into cases where it doesn't
work - so far I have only limited exposure to Shoulda, so it's entirely
possibly that I've missed something.

Cheers,
Erno
Back to top
bhauff



Joined: 03 Jul 2008
Posts: 13

PostPosted: Tue Mar 24, 2009 6:35 pm    Post subject: Netbeans Test Runner Shoulda Integration Reply with quote

Hello,

There are still some problems with Shoulda integration as of the nightly build 200903231401. When I run my test suite, which is a combination of pure Test/Unit and Shoulda, I cannot use the "Go to Source" or "Run Again" on Shoulda tests.

When I run "Go to Source" on a Shoulda test nothing happens in the IDE. When I run "Go to Source" on a Test/Unit test it goes to the expected test.

When I run "Run Again" on a Shoulda test the IDE attempts to rerun the test. The output of the runner then shows: Finished in 0.0 seconds. 0 tests, 0 failures, 0 errors. The runner shows a red bar with NaN %. When I run "Run Again" on a Test/Unit test it reruns the test and show 1 tests, 0 failures, 0 errors which a 100% green bar.
Back to top
Erno Mononen
Posted via mailing list.





PostPosted: Tue Mar 24, 2009 8:30 pm    Post subject: focused test execution for shoulda Reply with quote

Hi Brandon,

Can you please post an example test case where this happens? There seems
to be a bug in how the name of a shoulda test gets translated into a
method name. These kind of bugs should be straightforward to fix, just
that all the cases are apparently not covered yet.

Thanks,
Erno

bhauff wrote:
Quote:
Hello,



There are still some problems with Shoulda integration as of the nightly build 200903231401. When I run my test suite, which is a combination of pure Test/Unit and Shoulda, I cannot use the "Go to Source" or "Run Again" on Shoulda tests.



When I run "Go to Source" on a Shoulda test nothing happens in the IDE. When I run "Go to Source" on a Test/Unit test it goes to the expected test.



When I run "Run Again" on a Shoulda test the IDE attempts to rerun the test. The output of the runner then shows: Finished in 0.0 seconds. 0 tests, 0 failures, 0 errors. The runner shows a red bar with NaN %. When I run "Run Again" on a Test/Unit test it reruns the test and show 1 tests, 0 failures, 0 errors which a 100% green bar.











Back to top
Brandon Hauff
Posted via mailing list.





PostPosted: Tue Mar 24, 2009 9:56 pm    Post subject: focused test execution for shoulda Reply with quote

Hi Erno,

Do you need to provide a list of commands that could setup a new rails
project, create a scaffold, add a config.gem for shoulda, and a shoulda
test that then throws the error?

Or, do you just need a shoulda test, that would depend on all of the
things I described above, that fails?

Thanks,

Brandon

P.S. Won't have time to provide anything until tomorrow.

Quote:
-----Original Message-----
From: address-removed [mailto:address-removed]
Sent: Tuesday, March 24, 2009 3:30 PM
To: address-removed
Subject: Re: focused test execution for shoulda

Hi Brandon,

Can you please post an example test case where this happens? There
seems
to be a bug in how the name of a shoulda test gets translated into a
method name. These kind of bugs should be straightforward to fix, just
that all the cases are apparently not covered yet.

Thanks,
Erno

bhauff wrote:
Quote:
Hello,



There are still some problems with Shoulda integration as of the
nightly build 200903231401. When I run my test suite, which is a
combination of pure Test/Unit and Shoulda, I cannot use the "Go to
Source" or "Run Again" on Shoulda tests.
Quote:



When I run "Go to Source" on a Shoulda test nothing happens in the
IDE. When I run "Go to Source" on a Test/Unit test it goes to the
expected test.
Quote:



When I run "Run Again" on a Shoulda test the IDE attempts to rerun
the test. The output of the runner then shows: Finished in 0.0
seconds. 0 tests, 0 failures, 0 errors. The runner shows a red bar
with NaN %. When I run "Run Again" on a Test/Unit test it reruns the
test and show 1 tests, 0 failures, 0 errors which a 100% green bar.

Quote:
Quote:









Back to top
Erno Mononen
Posted via mailing list.





PostPosted: Wed Mar 25, 2009 8:09 am    Post subject: focused test execution for shoulda Reply with quote

If the problem is what I think it is, just a failing shoulda test is
enough. I'd then ask for more info if I couldn't reproduce for some reason.

Thanks,
Erno


Brandon Hauff wrote:
Quote:
Hi Erno,

Do you need to provide a list of commands that could setup a new rails
project, create a scaffold, add a config.gem for shoulda, and a shoulda
test that then throws the error?

Or, do you just need a shoulda test, that would depend on all of the
things I described above, that fails?

Thanks,

Brandon

P.S. Won't have time to provide anything until tomorrow.


Quote:
-----Original Message-----
From: address-removed [mailto:address-removed]
Sent: Tuesday, March 24, 2009 3:30 PM
To: address-removed
Subject: Re: focused test execution for shoulda

Hi Brandon,

Can you please post an example test case where this happens? There
seems
to be a bug in how the name of a shoulda test gets translated into a
method name. These kind of bugs should be straightforward to fix, just
that all the cases are apparently not covered yet.

Thanks,
Erno

bhauff wrote:

Quote:
Hello,



There are still some problems with Shoulda integration as of the

nightly build 200903231401. When I run my test suite, which is a
combination of pure Test/Unit and Shoulda, I cannot use the "Go to
Source" or "Run Again" on Shoulda tests.

Quote:

When I run "Go to Source" on a Shoulda test nothing happens in the

IDE. When I run "Go to Source" on a Test/Unit test it goes to the
expected test.

Quote:

When I run "Run Again" on a Shoulda test the IDE attempts to rerun

the test. The output of the runner then shows: Finished in 0.0
seconds. 0 tests, 0 failures, 0 errors. The runner shows a red bar
with NaN %. When I run "Run Again" on a Test/Unit test it reruns the
test and show 1 tests, 0 failures, 0 errors which a 100% green bar.



Quote:
Quote:
















Back to top
bhauff



Joined: 03 Jul 2008
Posts: 13

PostPosted: Wed Mar 25, 2009 2:07 pm    Post subject: Reply with quote

Hi Erno,

Here is what I did to identify some of the problems.

1) rails shoulda_test
2) cd shoulda_test
3) ruby script/generate scaffold post title:string body:text
4) rake db:create:all
5) rake db:migrate
6) config.gem 'thoughtbot-shoulda', :lib => 'shoulda' (add to environment.rb)
7) Add following test to posts_controller_test.rb

Code:

context "on GET to :show for first record" do
    setup do
      get :show, :id => posts(:one).id
    end

    should_assign_to :post
    should_respond_with :redirect
    should_render_template :show
    should_not_set_the_flash

    should "do something else really cool" do
      assert_equal posts(:one).id, 300
    end
  end


The tests above basically come from the shoulda rdocs under the controller tests section of the readme: http://dev.thoughtbot.com/shoulda/

The problems:

1) The test "should_respond_with :redirect" will fail, because it should be :success, and when I try to "Go to Source" it takes me to the macros.rb file in the shoulda gem rather than to my test.

2) If I try to use "Go to Source" on any passing test nothing happens (even the test/unit tests)

The working:
1) The "should do something else really cool" test that fails is targeted correctly when I use "Go to Source"

Notes: I can't seem to reliably reproduce the NaN in the test status bar. If I can I will post how.
Back to top
Erno Mononen
Posted via mailing list.





PostPosted: Wed Mar 25, 2009 7:21 pm    Post subject: focused test execution for shoulda Reply with quote

Thanks Brandon, I'm able to reproduce with your steps. I'll try address
this for 6.7, I'll ping here when it's fixed.

Cheers,
Erno

bhauff wrote:
Quote:
Hi Erno,



Here is what I did to identify some of the problems.



1) rails shoulda_test

2) cd shoulda_test

3) ruby script/generate scaffold post title:string body:text

4) rake db:create:all

5) rake db:migrate

6) config.gem 'thoughtbot-shoulda', :lib => 'shoulda' (add to environment.rb)

7) Add following test to posts_controller_test.rb




Code:


context "on GET to :show for first record" do

setup do

get :show, :id => posts(:one).id

end



should_assign_to :post

should_respond_with :redirect

should_render_template :show

should_not_set_the_flash



should "do something else really cool" do

assert_equal posts(:one).id, 300

end

end







The tests above basically come from the shoulda rdocs under the controller tests section of the readme: http://dev.thoughtbot.com/shoulda/



The problems:



1) The test "should_respond_with :redirect" will fail, because it should be :success, and when I try to "Go to Source" it takes me to the macros.rb file in the shoulda gem rather than to my test.



2) If I try to use "Go to Source" on any passing test nothing happens (even the test/unit tests)



The working:

1) The "should do something else really cool" test that fails is targeted correctly when I use "Go to Source"



Notes: I can't seem to reliably reproduce the NaN in the test status bar. If I can I will post how.











Back to top
Brandon Hauff
Posted via mailing list.





PostPosted: Wed Mar 25, 2009 7:34 pm    Post subject: focused test execution for shoulda Reply with quote

Sweet, thanks so much Erno! I hope that I am not the only Netbeans Ruby
user that is using Shoulda, but I appreciate your work even if I am:)

Quote:
-----Original Message-----
From: address-removed [mailto:address-removed]
Sent: Wednesday, March 25, 2009 2:21 PM
To: address-removed
Subject: Re: focused test execution for shoulda


Thanks Brandon, I'm able to reproduce with your steps. I'll try
address
Quote:
this for 6.7, I'll ping here when it's fixed.

Cheers,
Erno

bhauff wrote:
Quote:
Hi Erno,



Here is what I did to identify some of the problems.



1) rails shoulda_test

2) cd shoulda_test

3) ruby script/generate scaffold post title:string body:text

4) rake db:create:all

5) rake db:migrate

6) config.gem 'thoughtbot-shoulda', :lib => 'shoulda' (add to
environment.rb)
Quote:

7) Add following test to posts_controller_test.rb




Code:


context "on GET to :show for first record" do

setup do

get :show, :id => posts(:one).id

end



should_assign_to :post

should_respond_with :redirect

should_render_template :show

should_not_set_the_flash



should "do something else really cool" do

assert_equal posts(:one).id, 300

end

end







The tests above basically come from the shoulda rdocs under the
controller tests section of the readme:
http://dev.thoughtbot.com/shoulda/
Quote:



The problems:



1) The test "should_respond_with :redirect" will fail, because it
should be :success, and when I try to "Go to Source" it takes me to
the
Quote:
macros.rb file in the shoulda gem rather than to my test.
Quote:



2) If I try to use "Go to Source" on any passing test nothing
happens
Quote:
(even the test/unit tests)
Quote:



The working:

1) The "should do something else really cool" test that fails is
targeted correctly when I use "Go to Source"
Quote:



Notes: I can't seem to reliably reproduce the NaN in the test
status
Quote:
bar. If I can I will post how.

Quote:
Quote:









Back to top
bhauff



Joined: 03 Jul 2008
Posts: 13

PostPosted: Tue May 05, 2009 2:40 pm    Post subject: Reply with quote

Hi Erno,

Just thought I would add that the "Go to Source" for a passing Shoulda test in 6.7 Beta still does nothing. I think the other Shoulda issues all seem good.

Thanks,

Brandon
Back to top
Erno Mononen
Posted via mailing list.





PostPosted: Tue May 05, 2009 4:54 pm    Post subject: focused test execution for shoulda Reply with quote

Hi Brandon,

bhauff wrote:
Quote:
Hi Erno,



Just thought I would add that the "Go to Source" for a passing Shoulda test in 6.7 Beta still does nothing. I think the other Shoulda issues all seem good.


I was looking at this some time ago, but there was some problem with
this that I didn't have time to solve at that time. I'll have a look at
this again, thanks for notifying.

Cheers,
Erno
Back to top
bhauff



Joined: 03 Jul 2008
Posts: 13

PostPosted: Mon Dec 14, 2009 10:58 pm    Post subject: Reply with quote

I just wanted to update everyone that in Netbeans 6.8 you still cannot navigate to the source of a passing shoulda test.
Back to top
emononen



Joined: 04 Jul 2008
Posts: 8

PostPosted: Wed Dec 23, 2009 1:44 pm    Post subject: Re: focused test execution for shoulda Reply with quote

Hi Brandon,
I've filed https://netbeans.org/bugzilla/show_bug.cgi?id=179005 to track -- I confirmed that it indeed does not work. The problem is that currently we don't index test methods that Shoulda creates using define_method (dynamically created methods are a bit trickier for the IDE to index). But this is definitely fixable.

Cheers,
Erno

bhauff wrote:
I just wanted to update everyone that in Netbeans 6.8 you still cannot navigate to the source of a passing shoulda test.
Back to top
Brandon Hauff
Posted via mailing list.





PostPosted: Wed Dec 23, 2009 2:05 pm    Post subject: focused test execution for shoulda Reply with quote

This is great to hear Erno! Thanks so much.

-Brandon

Quote:
-----Original Message-----
From: emononen [mailto:address-removed]
Sent: Wednesday, December 23, 2009 7:45 AM
To: address-removed; address-removed
Subject: focused test execution for shoulda


Hi Brandon,
I've filed https://netbeans.org/bugzilla/show_bug.cgi?id=179005 to
track -- I confirmed that it indeed does not work. The problem is that
currently we don't index test methods that Shoulda creates using
define_method (dynamically created methods are a bit trickier for the
IDE to index). But this is definitely fixable.

Cheers,
Erno


bhauff wrote:
Quote:
I just wanted to update everyone that in Netbeans 6.8 you still
cannot navigate to the source of a passing shoulda test.




Back to top
Sondwely



Joined: 11 Oct 2010
Posts: 3

PostPosted: Mon Oct 11, 2010 8:40 am    Post subject: Reply with quote

The first(RS Gold) form in which we see synergy take place is through passive effects attached to various abilities; hence, this can be referred to (Buy WOW Gold)as passive synergy. An example of passive synergy would be the current Improved Insect Swarm talent. With this (RuneScape Gold)talent, you gain a larger benefit from casting either Wrath or WOW Starfire upon a target if Insect Swarm or WOW (WOW Gold)Moonfire is also on the target. Although there is an "active" means of application for this form of synergy you must first cast the DOTs in order to benefit the bonus effect that you gain requires no additional input, allowing you to reap the(Final Fantasy Gil) benefits passively.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Ruby Users All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo