Forum: RSpec having autospec run tests?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Joe Van D. (Guest)
on 2009-06-03 21:11
(Received via mailing list)
Hi,

On one project, I have cucumber features and test/unit (well, i guess
activesupport::testcase) tests.

I really like how:
AUTOFEATURE=true autospec
works on my projects that use rspec and cucumber.

Can I get that same behavior, but with my tests in the tests directory?

Joe
Stephen E. (Guest)
on 2009-06-03 22:06
(Received via mailing list)
On Wed, Jun 3, 2009 at 1:01 PM, Joe Van D. 
<removed_email_address@domain.invalid> wrote:
>
> I really like how:
> AUTOFEATURE=true autospec
> works on my projects that use rspec and cucumber.
>
> Can I get that same behavior, but with my tests in the tests directory?

Sure.  In fact it should work just fine out of the box: do the same
thing, but with 'autotest' instead of 'autospec'.  (The check for that
environment variable isn't in the autospec script, it's in the
discovery file that Cucumber sets up.)


--
Have Fun,
   Steve E. (removed_email_address@domain.invalid)
   ESCAPE POD - The Science Fiction Podcast Magazine
   http://www.escapepod.org
Joe Van D. (Guest)
on 2009-06-03 22:34
(Received via mailing list)
autotest doesn't seem to work for me, for some reason:

that file doesn't get loaded when autospec runs.

/home/joe/projects/zoolah/vendor/plugins/mocha/lib/mocha/integration/test_unit.rb:17:in
`remove_method': method `run' not defined in Test::Unit::TestCase
(NameError)
  from
/home/joe/projects/zoolah/vendor/plugins/mocha/lib/mocha/integration/test_unit.rb:17
  from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
  from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`polyglot_original_require'
  from
/home/joe/projects/zoolah/vendor/gems/polyglot-0.2.5/lib/polyglot.rb:54:in
`require'
  from
/home/joe/projects/zoolah/vendor/rails/activesupport/lib/active_support/dependencies.rb:158:in
`require'
  from
/home/joe/projects/zoolah/vendor/rails/activesupport/lib/active_support/dependencies.rb:265:in
`require_or_load'
  from
/home/joe/projects/zoolah/vendor/rails/activesupport/lib/active_support/dependencies.rb:425:in
`load_missing_constant'
  from
/home/joe/projects/zoolah/vendor/rails/activesupport/lib/active_support/dependencies.rb:80:in
`const_missing'
   ... 11 levels...
  from /usr/local/lib/ruby/1.8/test/unit/autorunner.rb:216:in `run'
  from /usr/local/lib/ruby/1.8/test/unit/autorunner.rb:12:in `run'
  from /usr/local/lib/ruby/1.8/test/unit.rb:278
  from -e:1
This topic is locked and can not be replied to.