• 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

[追記 2009.01.20]script/generate featureの項を追加

moroさんの記事を読んで、Cucumber wktk!と思っていたのでtry

http://d.hatena.ne.jp/moro/20081112/1226486135
http://d.hatena.ne.jp/moro/20081118/1226977015
http://gist.github.com/26024

こちらの導入手順を参考しました:
http://wiki.github.com/aslakhellesoy/cucumber/ruby-on-rails

###必要なgemをinstall

  • rspec
  • rspec-rails
  • cucumber
  • webrat

ローカルには0.1.15を入れたのですが、念のため0.1.13で依存しているというgem:aslakhellesoy-webratもinstallしました。

shell>>
gem sources -a http://gems.github.com
sudo gem install aslakhellesoy-webrat
<<--

###Webratを使うようにCucumberのenvに書く
${RAILS_ROOT}/features/support/env.rb

shell>>
require "webrat"
Webrat.configure do |config|
config.mode = :rails
end
<<--

###script/generate feature
moroさんところのcucumberの構造辺りで紹介されているgeneratorでfeatureやstepsを生成:

shell>>
$ ruby script/generate feature Product
<<--

###Webratの仕様が変わってた
moroさんのgistを下記に保存して使用し始めたのですが、
shell>>
${RAILS_ROOT}/features/step_definitions/webrat_ja_steps.rb
<<--

細かい仕様が変更されていました:
ディレクトリstep_definitionsの位置も変わっているのに加えて、visits => visit、fills_in => fill_inなどが変更されていました。ただ、前もって調べなくても、rake featuresすると仕様変更された旨のmessageが出るので安心です。

rails>>
visit home_path
fill_in "Email", :with => "good@example.com"
<<--

またpendingされたstepには、下記のようにsnippetsが出力されて便利だなぁと思いました:

shell>>
You can use these snippets to implement pending steps which have no step definition:
When /^パラメータを入力する product_comment[body]=dummy comment!$/ do
end
<<--

###Refs
http://moriq.tdiary.net/20081022.html
http://d.hatena.ne.jp/hs9587/20081231/1230691812
http://barkingiguana.com/2008/11/11/getting-started-with-story-driven-development-for-rails-with-cucumber

posted by satoko satoko on Mon 19 Jan 2009 at 15:44 with 0 comments
Contents rssrss
NSAssertやNSLogを無効にする:-DNS_BLOCK_ASSERTIONS=1とNS_BLOCK_ASSERTIONS
GDBでview.frameを表示させる
Core Animationについてのリンク集
[iPhone] new BSDライセンスについてライセンス引用のメモ
Implementing a Container View Controller in UIViewController Class Reference
UITableView用のNSIndexPathの作り方
Xcodeのテンプレート、View-based ApplicationとWindow-based Applicationの違い
CopyOnSelectのLion対応
Xcode4のCode Snippetsを別のPCに移動する+gitで管理する
[iPhone] Singleton: iOS4以降はGCDのdispatch_onceを使う
Tags
iphone開発gitIBInterfaceBuilderiOSSIMBLSnippetsterminaltwitterxcodeXcode4
Comments rssrss
https://buy-property-uae.com/ https://buy-property-uae.com/: Many international investors believe, in today's e... 04/24 00:16
https://www.gms4you.us/ https://www.gms4you.us/: Reliable reviews confirm, in today's world using l... 04/21 19:41
https://rootskitchen.bar/ https://rootskitchen.bar/: Finished a deadly evening session punting on crash... 04/18 12:17
https://rootskitchen.bar/ https://rootskitchen.bar/: Just wrapped up a cracking arvo session grinding c... 04/17 02:19
https://si-design.ru/o-nas https://si-design.ru/o-nas: Цена дизайн-проекта стабильна и не изменится к кон... 04/10 17:15
https://corporativ-luxe.ru/magiya-solnechnoy-kapli https://corporativ-luxe.ru/magiya-solnechnoy-kapli: Мы работаем для вас без выходных и праздников htt... 04/10 16:20
https://si-design.ru/reutov https://si-design.ru/reutov: Интерьер, оформленный в стиле модернизм, отличаетс... 04/08 06:24
https://sbornye-gruzy-kitay.ru/ https://sbornye-gruzy-kitay.ru/: Реально ли привезти косметику? Там же нужны особые... 04/08 03:06