2011-06-26 12 views
8

यहाँ मेरी gemfileएक परीक्षण विफल होने के बाद ऑटोटैस्ट नहीं रुक जाएगा?

है
source 'http://rubygems.org' 

gem 'rails', '3.0.9' 
gem 'mysql2', '~> 0.2.6' 

group :development do 
    gem 'rspec-rails' 
end 

group :test do 
    gem 'rspec' 
end 

काफी सरल और कुछ भी नहीं असामान्य। उत्तीर्ण करने के लिए परीक्षण पर Autotest अच्छा काम करता है और बंद हो जाता है जैसे कि यह चाहिए

Finished in 0.1158 seconds 
4 examples, 0 failures 
/Users/alex/.rvm/rubies/ruby-1.9.2-p180/bin/ruby -rrubygems -S /Users/alex/.rvm/gems/[email protected]/gems/rspec-core-2.6.4/bin/rspec --tty '/Users/alex/Sites/slacklog/spec/controllers/pages_controller_spec.rb' 

लेकिन जब एक परीक्षण अपने एक अंतहीन लूप में विफल रहता है कि

Failures: 

    1) PagesController GET 'contact' Should have the proper title for the contact page 
    Failure/Error: response.should have_selector("contact", 
     expected following output to contain a <contact>Contact us</contact> tag: 
     <!DOCTYPE html> 
     <html> 
     <head> 
     <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> 
     <title>Slacklog</title> 
     <script src="/javascripts/jquery.js" type="text/javascript"></script><script src="/javascripts/jquery_ujs.js" type="text/javascript"></script><script src="/javascripts/application.js?1309037322" type="text/javascript"></script> 
     </head> 
     <body> 

     <h1>Pages#contact</h1> 
     <p>Find me in app/views/pages/contact.html.erb</p> 


     </body> 
     </html> 
    # ./spec/controllers/pages_controller_spec.rb:32:in `block (3 levels) in <top (required)>' 

Finished in 0.16647 seconds 
5 examples, 1 failure 

Failed examples: 

rspec ./spec/controllers/pages_controller_spec.rb:30 # PagesController GET 'contact' Should have the proper title for the contact page 
/Users/alex/.rvm/rubies/ruby-1.9.2-p180/bin/ruby -rrubygems -S /Users/alex/.rvm/gems/[email protected]/gems/rspec-core-2.6.4/bin/rspec --tty '/Users/alex/Sites/slacklog/spec/controllers/pages_controller_spec.rb' 
...F. 

Failures: 

नाकाम रहने रहता है यह

दोहरा रहता है मैं कैसे रोक सकता हूं यह व्यवहार

उत्तर

3

मुझे एक ही समस्या थी।

sudo gem install autotest-rails 
sudo gem install rspec-rails 
+0

मेरे लिए कुछ भी हल नहीं किया। – staackuser2

4

डुप्लिकेट प्रश्न उचित ठीक है कि नहीं है: अपने ZenTest मणि स्थापना रद्द करें और के रूप में निर्भरता के माध्यम से इसे पुनः स्थापित करने की कोशिश करो Autotest inifinitely looping

जवाब या तो मेरे लिए यह ठीक नहीं हुआ है, लेकिन ऐसा इसलिए था क्योंकि मैं Webrat का उपयोग कर रहा था और webrat.log बनाया जा रहा था, जिसके कारण परीक्षण फिर से शुरू हो गए। इसलिए मैं उनके जवाब संशोधित शामिल करने के लिए webrat.log

यहाँ संशोधित समाधान है:

मैं समाधान मिल गया। शायद ओएसएक्स (इसे तेंदुए पर चलाना) फ़ोल्डर या किसी अन्य temp फ़ाइल में .DS_Store फ़ाइल को बदलना है। मेरे .autotest में निम्नलिखित जोड़ना चाल था (यह फेरेट द्वारा जेनरेट किए गए इंडेक्स फ़ोल्डर को स्वचालित रूप से देखता है)।

Autotest.add_hook :initialize do |at| 
    %w{.git webrat.log vendor index .DS_Store ._}.each {|exception| at.add_exception(exception)} 
end 
2

बस में निम्नलिखित रख कर यह तय मेरी .autotest मैं जानता हूँ कि यह बहुत देर हो चुकी है, लेकिन मुझे उम्मीद है कि इस में मदद मिलेगी किसी :-)

at.add_exception %r{^./log} 

मेरे .autotest अब लग रहा है

# ./.autotest 
Autotest.add_hook(:initialize) {|at| 
    at.add_exception %r{^\.git} # ignore Version Control System 
    at.add_exception %r{^./tmp} # ignore temp files, lest autotest will run again, and again... 
    at.add_exception %r{^./spec/controllers} # ignore controllers until cache has been fixed. auto test taking too long for now 
    at.add_exception %r{^./log} # ignore temp files, lest autotest will run again, and again... 


    # at.clear_mappings   # take out the default (test/test*rb) 
    at.add_mapping(%r{^lib/.*\.rb$}) {|f, _| 
    Dir['spec/**/*_spec.rb'] 
    } 
    nil 
} 

require 'autotest/inotify' 
की तरह
+0

उत्तर देने के लिए धन्यवाद, यह मेरे लिए काम किया! (आवश्यकता के बिना 'autotest/inotify') – lambinator

+0

सुनने के लिए खुशी हुई, @SteveLamb :-) – Abdo

संबंधित मुद्दे