| View previous topic :: View next topic |
| Author |
Message |
Chris Kutler Posted via mailing list.
|
Posted: Fri Oct 10, 2008 1:53 am Post subject: Question about Autotest with Ruby projects (deleting spec folder) |
|
|
Hi,
By running JRuby -S autotest from the root of the application, I see that autotest tries to load autotest/rspec if the spec folder is there, but does not try to do that if I delete the spec folder
Ruby projects that are added using the New Project wizard have spec folders, so it appears that if you have unit tests that you want autotest to run, you must delete your spec folder.????
Am I wrong?
I cannot figure out how to get autotest to work with Ruby projects so I am not be able to test these things myself.
I did verify from the command line that autotest does try to load autotest/rspec if the spec folder is there , but does not try to do that if I delete the spec folder |
|
| Back to top |
|
 |
Erno Mononen Posted via mailing list.
|
Posted: Fri Oct 10, 2008 1:46 pm Post subject: Question about Autotest with Ruby projects (deleting spec folder) |
|
|
Hi Chris,
Chris Kutler wrote:
| Quote: | Hi,
**By running JRuby -S autotest from the root of the application, I see
that autotest tries to load autotest/rspec if the spec folder is
there, but does not try to do that if I delete the spec folder
Ruby projects that are added using the New Project wizard have spec
folders, so it appears that if you have unit tests that you want
autotest to run, you must delete your spec folder.????
|
Either that or you need to uninstall the rspec gem.
| Quote: |
Am I wrong?
I cannot figure out how to get autotest to work with Ruby projects so
I am not be able to test these things myself.
|
It occurred to me that maybe your problems are caused by the naming
scheme that AutoTest expects (from ZenTest-3.10.0/lib/autotest.rb):
# Naming:
#
# Autotest uses a simple naming scheme to figure out how to map
# implementation files to test files following the Test::Unit naming
# scheme.
#
# * Test files must be stored in test/
# * Test files names must start with test_
# * Test class names must start with Test
# * Implementation files must be stored in lib/
# * Implementation files must match up with a test file named
# test_.*implementation.rb
#
# Strategy:
#
# 1. Find all files and associate them from impl <-> test.
# 2. Run all tests.
# 3. Scan for failures.
# 4. Detect changes in ANY (ruby?. file, rerun all failures + changed files.
# 5. Until 0 defects, goto 3.
# 6. When 0 defects, goto 2.
I think I didn't find a way to include also *_test.rb files when running
AutoTest from the IDE, but I need to check that -- will do that once I'm
finished with the high priority bugs that I need to work on now. Likely
possible to do that in a .autotest file in the project, but don't know
now off hand how exactly, will look that up.
Erno |
|
| Back to top |
|
 |
Chris Kutler Posted via mailing list.
|
Posted: Fri Oct 10, 2008 5:17 pm Post subject: Question about Autotest with Ruby projects (deleting spec folder) |
|
|
Thanks Erno, this is helpful.
By renaming my unit test files from xxx_test to test_xxx I now see autotest working for unit test for MRI ruby but not for JRuby.
I have verified that this is true at the command line also.
That is...
ruby -S autotest at the command line starts up autotest and autotest runs my tests that begin with test_.
jruby -S autotest at the command line starts autotest but no message get emitted.
I posted the command line output below.
I will look to see if anyone has reported problems with zentest and jruby.
If anyone can walk me through a simple example of how to get autotest to work with JRuby in a Ruby (not Rails) application, I would really appreciate it.
I haven't found the secret on how to get autotest to work for spec files for Ruby projects. All of the documentation I am finding is for Rails projects.
Anyone have any pointers to good ZenTest tutorials or documentation for standalone Ruby and rspec? Here is what I found so far
http://snippets.aktagon.com/snippets/134-How-to-use-RSpec-and-ZenTest-in-a-standalone-Ruby-project
http://zentest.rubyforge.org/ZenTest/
I know my questions are coming at a bad time but my deadlines are looming also. I really appreciate your help.
Command Line Tests
In a project with files in test but no files in spec
>jruby -S autotest
C:\Program Files\NetBeans Dev 200810091401\ruby2\jruby-1.1.4\bin\jruby.bat -I.;l
ib;test -rtest/unit -e "%w[test/test_item.rb].each { |f| require f }" | unit_dif
f -u
| Quote: | | Quote: | | Quote: | | Quote: | nothing else emitted
|
|
|
| Interrupt a second time to quit
Terminate batch job (Y/N)? y
>ruby -S autotest
c:\ruby\bin\ruby -I.;lib;test -rtest/unit -e "%w[test/test_item.rb].each { |f| r
equire f }" | unit_diff -u
Loaded suite -e
Started
F
Finished in 0.016 seconds.
1) Failure:
test_foo(ItemTest) [./test/test_item.rb:12]:
TODO: Write test.
1 tests, 2 assertions, 1 failures, 0 errors
Unable to map class ItemTest to a file
The following is in an application with no files in the test folder but with files in the spec folder. I only got this to emit something once. Cannot duplicate this. That is, I can't get it to emit the loading message nor the echoing of the command unter the loading message anymore.
>jruby -S autotest
loading autotest/rspec
C:\Program Files\NetBeans Dev 200810091401\ruby2\jruby-1.1.4\bin\jruby.bat -S C:
\Program Files\NetBeans Dev 200810091401\ruby2\jruby-1.1.4\lib\ruby\gems\1.8\gem
s\rspec-1.1.4\bin\spec spec/transcoder_spec.rb spec/item_spec.rb spec/helper.rb
| Quote: | | Quote: | | Quote: | nothing else emitted
|
|
| Interrupt a second time to quit
Terminate batch job (Y/N)?
^C
Erno Mononen wrote: | Quote: | Hi Chris,
Chris Kutler wrote:
| Quote: | Hi,
**By running JRuby -S autotest from the root of the application, I see that autotest tries to load autotest/rspec if the spec folder is there, but does not try to do that if I delete the spec folder
Ruby projects that are added using the New Project wizard have spec folders, so it appears that if you have unit tests that you want autotest to run, you must delete your spec folder.????
|
Either that or you need to uninstall the rspec gem.
| Quote: |
Am I wrong?
I cannot figure out how to get autotest to work with Ruby projects so I am not be able to test these things myself.
|
It occurred to me that maybe your problems are caused by the naming scheme that AutoTest expects (from ZenTest-3.10.0/lib/autotest.rb):
# Naming:
#
# Autotest uses a simple naming scheme to figure out how to map
# implementation files to test files following the Test::Unit naming
# scheme.
#
# * Test files must be stored in test/
# * Test files names must start with test_
# * Test class names must start with Test
# * Implementation files must be stored in lib/
# * Implementation files must match up with a test file named
# test_.*implementation.rb
#
# Strategy:
#
# 1. Find all files and associate them from impl <-> test.
# 2. Run all tests.
# 3. Scan for failures.
# 4. Detect changes in ANY (ruby?. file, rerun all failures + changed files.
# 5. Until 0 defects, goto 3.
# 6. When 0 defects, goto 2.
I think I didn't find a way to include also *_test.rb files when running AutoTest from the IDE, but I need to check that -- will do that once I'm finished with the high priority bugs that I need to work on now. Likely possible to do that in a .autotest file in the project, but don't know now off hand how exactly, will look that up.
Erno
([email]address-removed[/email])
([email]address-removed[/email])
|
|
|
| Back to top |
|
 |
|
|
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 can attach files in this forum You can download files in this forum
|
|
|
|