Supporting CruiseControl.rb configuration RSpec

2009-05-19  来源:本站原创  分类:Ruby  人气:705 

CruiseControl process for Rails has a lot of help, but has been in traditional use of test cases to test. RSpec now want to use the project-based, the use of CruiseControl. Then it can be installed in accordance with the following steps:

rake db:test:purge
    rake db:migrate
    rake test

However, by default in the implementation of CruiseControl is still time to build the implementation of test cases built-in Rails so we can make the following changes to be able to make CruiseControl calls RSpec tests.
Then, create the following rake tasks:

RAILS_ROOT/lib/tasks/custom_cc.rake
desc 'Custom curise task for RSpec'
   task :cruise do
         ENV['RAILS_ENV'] = 'test'  

         if File.exists?(Dir.pwd + "/config/database.yml")
           if Dir[Dir.pwd + "/db/migrate/*.rb"].empty?
             raise "No migration scripts found in db/migrate/ but database.yml exists, " +
                   "CruiseControl won't be able to build the latest test database. Build aborted."
           end  

              #perform standard Rails database cleanup/preparation tasks if they are defined in project
              #this is necessary because there is no up-to-date development database on a continuous integration box
           if Rake.application.lookup('db:test:purge')
             CruiseControl::invoke_rake_task 'db:test:purge'
           end 

           if Rake.application.lookup('db:migrate')
             CruiseControl::reconnect
             CruiseControl::invoke_rake_task 'db:migrate'
           end
         end 

         CruiseControl::invoke_rake_task 'spec:all'
   end 

This, CruiseControl.rb can build at a time when the RSpec calls.

相关文章
  • Supporting CruiseControl.rb configuration RSpec 2009-05-19

    CruiseControl process for Rails has a lot of help, but has been in traditional use of test cases to test. RSpec now want to use the project-based, the use of CruiseControl. Then it can be installed in accordance with the following steps: rake db:test

  • CruiseControl.rb configuration 2010-04-13

    Download CruiseControl.rb Extract tar xzvf cruisecontrol-1.4.0.tgz Rename mv cruisecontrol-1.4.0 /var/www/ccrb Start ccrb background /var/www/ccrb/cruise start -d Note that access rights (chmod-R 777 / var / www / ccrb) Once started, you can visit cc

  • Plug-ins Introduction CruiseControl.rb 2009-05-19

    ThoughtWorks has a java based on the CruiseControl, Home Page at Here So far, the 2.8.2 update Quote Continuous Integration (Continuous Integration) the term derived from the XP (Extreme Programming), a best practice, with the XP community grow in re

  • About CruiseControl.rb continuous integration tools, instructions 2010-11-24

    <! - [If gte mso 9]> <xml> <o:OfficeDocumentSettings> <o:RelyOnVML/> <o:AllowPNG/> </ o: OfficeDocumentSettings> </ xml> <! [Endif ]-->< ! - [if gte mso 9]> <xml> <w:WordDocument> <w:Vie

  • CruiseControl.rb another Bug 2009-11-04

    I encountered the problem as follows: Executive: . / cruise build test_cc_01 Time, there will be the following error? SVN is literally no permissions to connect, but I tried a lot of SVN, but I have passed before. / Cruise add method SVN had pulled d

  • This is the Bug Bar CruiseControl.rb 2009-10-30

    Home is not Linux, wanted to run under very CC.rb, Recently, under a project requires an understanding of continuous integration, so at home to download the latest CC.rb loaded up, and cruise add two projects The problem is that the CC running, the p

  • CruiseControl in-depth analysis 2010-02-27

    CruiseControl is a green version, that is, the core of his program has nothing to do with the Windows registry, the system re-install the program after the same can be used. Mentioned here is version 2.2.8, older versions of CruiseControl may be rela

  • Radiant in the deployment of Heroku 2009-07-14

    Heroku: very commendable RoR service provider (the service is good, but also free of charge) Radiant: Open Source RoR based CMS. Original: http://blog.heroku.com/archives/2009/3/26/radiant_cms_in_5_minutes_or_less/ The deployment of the effect of: ht

  • Rails3 one study notes, Mid-Autumn Festival holiday 2010-09-24

    Long time no write code, and very itchy. Face of the upcoming holiday, a study intended to Rails3 good, given the level of their rookie Rails2 is, first of all attitudes and learn every day. Second, the war is still learning methodology to learn war,

  • Rails3 study notes 1, Mid-Autumn Festival holiday 2010-09-24

    For a long time without writing code, and very itchy. The face of the upcoming holiday, intended to Rails3 a proper study, given the level of their rookie Rails2 is, first of all have good attitudes, good learning, every day. Second, the war is still

  • Ruby on Rails Tutorial (Michael Hartl) Chinese translation of static pages of Chapter III (2) 2010-12-22

    3.1.1 Let the real static pages from the static pages really start learning, review Section 1.2.5 on the start of each program on Rails is a very small program (mainly the Rails script credit, such as generator ) and have a default welcome page (addr

  • Neal Ford谈编程语言和平台 2015-02-21

    这是来自在三藩市举行的QCon大会上的采访,今天接受我们采访的是Neal Ford.Neal,首先能否向大家简单介绍一下您自己和您的工作? 我在ThoughtWorks工作.我们公司是一个国际化的咨询公司.我在公司的职称是软件构架师,但在美国,很多时候,职称意味着post- useful,或者只能说我十年前曾用COBOL写过些当时超赞的代码.在TW工作其中一个好处是可以选择自己喜欢的职称,所以我给自己的头衔是Meme Wrangler.Meme指的是思考单位--这是思考单位在数学上的表示,也指代

  • 有助于你编程而立即要做的10件事 2014-09-05

    我们一直努力又努力去掌握那些对于我们来说是全新的东西.那么,我们做什么来帮助学习?下面是一个关于如何使你编程更迅速合理的10件事情的列表.我更习惯与使用Ruby on Rails,但下面的观点也适用于其他环境. 1.升级单元测试 你的编程没有测试?你应当随时进行测试,即TATFT ( testing all the fucking time ).当然你应当选择比仅是单元测试更好的方式.RSpec和Shoulda是两个可以选来使用的工具. 2.试用TDD 既然你在测试,那你就应当记录下这些测试.不

  • Liu prepared to do the project - on the life cycle model 2009-07-15

    Excerpt from: Here The article is true, at least from a theoretical point of view, in simple language about the common software engineering wood "prototyping, coding - to amend the Law, the traditional waterfall, to improve the waterfall, incremental

  • MongoDB and MongoMapper sample usage profile 2010-03-02

    MongoDB and MongoMapper sample usage profile Translator: Night Ming pig (http://hlee.javaeye.com/) Proofreading: wow cow (http://ywencn.javaeye.com/) MongoDB database engine based on the document, which the traditional relational database, such as My

  • Rights Management gem devise a popular custom 2010-05-23

    Devise a presentation in the last [video] reading, we have been able to build our Rails applications and use the basic functions of the devise. Now, we introduce the one question left to begin to explain how to customize the devise. In a previous pre

  • webservice-XFire Introduction 2010-08-16

    XFire overview: XFire is codeHaus organizations an open source framework, which built a bridge between POJO and the SOA, the main feature is supported by a very simple way POJO released into Web services, this approach not only give full play to the

  • Continuous Integration brief summary 2008-09-09

    A theoretical articles: Continuous integration period as short as possible to encourage the project team to submit the code, while ensuring that every check in will not damage our building through. It is built with daily difference is that the code s

  • cruisecontrolrb support git branch 2011-02-25

    Quote https://github.com/thoughtworks/cruisecontrol.rb . / Cruise add - help usage: add [project-name] -r [repository] -s [svn|git|hg|bzr] -r, --repository repository Location of the source control repository for the project (eg. svn://rubyforge.org/

  • 0.11 kernel linux study notes 2011-03-28

    linux0.11 core directory structure linux | | --- Boot boot assembler | | --- Fs file system | | --- Include header files (*. h) | | | | --- Asm CPU architecture associated with the part | | | | --- Linux Linux kernel specific part of the | | | | ---