开发者

Autotest, RSpec 2 and Ruby 1.9.2-p0 - no output at all

I have started the book Continuous Testing with Ruby (B2.0 printing), but am running into immediate problems. Per the first chapter, I have created an empty Gem using Jeweler 1.5.1

$ jeweler --rspec twits

Running the specs manually with rake gives the correct failing output

$ rake spec
(in /Users/mfurtak/Documents/Programming/Ruby/twits)
/Users/mfurtak/.rvm/rubies/ruby-1.9.2-p0/bin/ruby -S bundle exec rspec "spec/twits_spec.rb"
F

Failures:
  1) Twits fails
     Failure/Error: fail "Trying to get this working"
     Trying to get this working
     # ./spec/twits_spec.rb:5:in `block (2 levels) in '

Finished in 0.00176 seconds
1 example, 1 failure
rake aborted!

To get Autotest configured for RSpec 2, I have created ./autotest/discover.rb in the root of my project as described in the book and elsewhere with the following contents:

Autotest.add_discovery { "rspec2" }
开发者_JAVA技巧

But when I attempt to run the RSpec (2.2.0) specs through autotest (ZenTest 4.4.0), I get no output at all.

$ autotest

This is all using Ruby 1.9.2-p0 through RVM (1.0.2). If I switch to Ruby 1.8.7-p302, things work as expected.

$ autotest
loading autotest/rspec2
bundle exec /Users/mfurtak/.rvm/rubies/ruby-1.8.7-p302/bin/ruby -S /Users/mfurtak/.rvm/gems/ruby-1.8.7-p302/gems/rspec-core-2.2.1/bin/rspec --tty '/Users/mfurtak/Documents/Programming/Ruby/twits/spec/twits_spec.rb'
F

Failures:

  1) Twits fails
     Failure/Error: fail "Trying to get this working"
     Trying to get this working
     # ./spec/twits_spec.rb:5

Finished in 0.00036 seconds
1 example, 1 failure


=]

I created this gem that is an alternative to Autotest that I think will help with your problem. Called InfinityTest. (need RVM ok?)

For more information see:

https://github.com/tomas-stefano/infinity_test

If you have any problem let me know in gitub that I'll help you! =)


Noting the italic emphasis on autotest on this wiki page, I uninstalled the ZenTest (4.4.0) gem and instead installed the autotest (4.4.5) gem. After that and a

$ bundle install

things are working correctly in both Ruby 1.9.2-p0 and Ruby 1.8.7-p302

$ autotest
loading autotest/rspec2
style: Rspec2
bundle exec /Users/mfurtak/.rvm/rubies/ruby-1.9.2-p0/bin/ruby -S /Users/mfurtak/.rvm/gems/ruby-1.9.2-p0/gems/rspec-core-2.2.1/bin/rspec --tty '/Users/mfurtak/Documents/Programming/Ruby/twits/spec/twits_spec.rb'
F

Failures:

  1) Twits fails
     Failure/Error: fail "Trying to get this working"
     Trying to get this working
     # ./spec/twits_spec.rb:5:in `block (2 levels) in '

Finished in 0.00036 seconds
1 example, 1 failure
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜