Ubuntu上使用autotest做Rails项目的自动测试 - autotest安装和测试
2012-01-08 09:06
676 查看
Automate Everything: Ruby, Linux and other hints, tips and tricks.
注:不需要安装autotest (参考Ruby on Rails 3 Tutorial:
3.2.1 Testing tools),好像是ZenTest里面有autotest了。
安装ZenTest gem
然后安装libnotify-bin package
在Home目录创建文件 ~/.autotest 内容如下
和原文Automate Everything 唯一不同的地方是要掉redgreen那一行。
下载红绿图片到目录~/.autotest_images/.
autotest_images.zip
在Ubuntu X Windows Gnome窗口里面,按CTL + ALT打开一个Terminal窗口,进入你的Rails项目目录,执行autotest,会自动反复测试你的项目,并弹出如上面的X Windows窗口提示你有多少个测试Pass了,多少个测试Failed。
参考:
Rails项目配置rspec: Ruby on Rails 3 Tutorial:
3.2.1 Testing tools
安装配置:Automate Everything
安装配置:http://jetpackweb.com/blog/2009/09/01/autotest-notifications-on-ubuntu-using-lib-notify/
Gnome and Autospec Notifications
注:不需要安装autotest (参考Ruby on Rails 3 Tutorial:
3.2.1 Testing tools),好像是ZenTest里面有autotest了。
安装ZenTest gem
$ sudo gem install ZenTest $ sudo gem install redgreen
然后安装libnotify-bin package
$ sudo apt-get install libnotify-bin
在Home目录创建文件 ~/.autotest 内容如下
和原文Automate Everything 唯一不同的地方是要掉redgreen那一行。
#!/bin/ruby # remove this line on Unbuntu 11 : require 'redgreen' require 'autotest/timestamp' module Autotest::GnomeNotify def self.notify title, msg, img system "notify-send '#{title}' '#{msg}' -i #{img} -t 3000" end Autotest.add_hook :ran_command do |at| image_root = "~/.autotest_images" results = [at.results].flatten.join("\n") results.gsub!(/\\e\[\d+m/,'') output = results.slice(/(\d+)\sexamples?,\s(\d+)\sfailures?(,\s(\d+)\spending?|)/) full_sentence, green, failures, garbage, pending = $~.to_a.map(&:to_i) if output if failures > 0 notify "FAIL", "#{output}", "#{image_root}/fail.png" elsif pending > 0 notify "Pending", "#{output}", "#{image_root}/pending.png" else notify "Pass", "#{output}", "#{image_root}/pass.png" end end end end
下载红绿图片到目录~/.autotest_images/.
autotest_images.zip
在Ubuntu X Windows Gnome窗口里面,按CTL + ALT打开一个Terminal窗口,进入你的Rails项目目录,执行autotest,会自动反复测试你的项目,并弹出如上面的X Windows窗口提示你有多少个测试Pass了,多少个测试Failed。
参考:
Rails项目配置rspec: Ruby on Rails 3 Tutorial:
3.2.1 Testing tools
安装配置:Automate Everything
安装配置:http://jetpackweb.com/blog/2009/09/01/autotest-notifications-on-ubuntu-using-lib-notify/
相关文章推荐
- Ubuntu 上安装jenkins 自动测试ruby on rails
- 搭建Rails测试环境2: Autotest和Spork的安装和配置
- 搭建Rails测试环境2: Autotest和Spork的安装和配置
- 使用Android Studio进行UI测试与Record Espresso Test自动生成测试代码
- Ubuntu安装GoogleTest框架并测试C++代码
- Ubuntu 16.04 vim YouCompleteMe自动补全的安装配置与使用
- Rails项目中使用Cucumber测试
- 使用vs2010的Coded UI Test实现数据驱动的用户自动登录测试
- VSTS 编写测试Test技巧:如何使用Deployment Items在测试类中引用文件,和普通Windows项目不一样哦。
- Ubuntu/CentOS下使用脚本自动安装 Docker
- ubuntu 11.10 使用 emacs-23.4 开发 erlang 整理 之 auto-complete 插件的安装
- 使用vs2010的Coded UI Test实现数据驱动的用户自动登录测试
- Masonry的使用->在项目中使用Masonry实现自动布局Autolayout(1)
- ubuntu16.04编译安装mysql-boost-5.7.21并编译成php扩展测试与使用
- apache服务器安装以及使用passenger插件部署rails应用,基于ubuntu 12.04 LTS
- 使用Record Espresso Test功能自动生成测试代码
- ubuntu14.10 安装git并且使用CSDN提供的git服务器管理项目代码
- 使用RVM在ubuntu下安装ruby&rails
- 使用GNU Autotools 自动编译项目