<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
		xmlns:xhtml="http://www.w3.org/1999/xhtml"
>

<channel>
	<title>Aerialarts &#187; rspec</title>
	<atom:link href="http://aerial.st/tags/rspec/feed" rel="self" type="application/rss+xml" />
	<link>http://aerial.st</link>
	<description></description>
	<lastBuildDate>Thu, 22 Jul 2010 13:00:53 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://aerial.st/tags/rspec/feed" />
		<item>
		<title>Machinist+DatasetでFixture代替</title>
		<link>http://aerial.st/archive/2010/02/20/fixture-replacement</link>
		<comments>http://aerial.st/archive/2010/02/20/fixture-replacement#comments</comments>
		<pubDate>Fri, 19 Feb 2010 16:53:45 +0000</pubDate>
		<dc:creator>ikm</dc:creator>
				<category><![CDATA[開発]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[rspec]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://aerial.st/?p=625</guid>
		<description><![CDATA[概要 Machinistは定義された条件下でテストデータを生成するプラグイン・gem。 DatasetはRubyのコードで記述したテストデータをDBに読み込むプラグイン・gem。 この2つを組み合わせることで（比較的）メンテナンスのしやすいfixtureの代替を構築することが可能になる。 流れとしては、Dataset上でMachinistを呼び出して複数のデータを生成して、それをDBに流し込むという感じ。 メリットは、 条件下でランダムなデータを生成してくれる（「特定のデータをfixture上に作って読み込む」というようなことも可能） リレーション先のデータも適宜生成してくれる（素敵！）。 デメリットは、 データがランダムなので、全条件を必ずカバーするのは苦手＆毎回同じデータが入ってくるとは限らない（回避できるかなぁ） fixtureに依存した書き方をしていると大幅な書き換えが必要かもしれない（レコード数によるテストなど。集計系では難しい…） 最終結果のコードをGithubにあげたので、そちらも参考に。 下準備 Machinist、Dataset、そして適当な文字列のデータを作ってくれるFakerをインストール・設定する。なおテストフレームワークにはRSpec on Railsを用いる。 YAMLに頼らないテストデータの作成を参考にさせていただきました。 Machinist $ cd RAILS_ROOT $ ruby script/plugin install git://github.com/notahat/machinist.git $ vi spec/blueprints.rb # 新規作成/下記参照 $ vi spec/spec_helper.rb # 下記参照 RAILS_ROOT/spec/blueprints.rbに追記： require 'machinist/active_record' require 'sham' RAILS_ROOT/spec/spec_helper.rbに追記： # 冒頭のほうに記述 require File.expand_path(File.dirname(__FILE__) + "/blueprints") # Spec::Runner.configureブロック内に以下を記述 # -> Shamで1度生成したデータはリスト形式でキャッシュされ、 # 以降はbeforeが呼ばれるたびにその先頭から順に取り出すようになる [...]]]></description>
		<wfw:commentRss>http://aerial.st/archive/2010/02/20/fixture-replacement/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://aerial.st/archive/2010/02/20/fixture-replacement" />
	</item>
		<item>
		<title>install rspec</title>
		<link>http://aerial.st/archive/2009/08/09/install-rspec</link>
		<comments>http://aerial.st/archive/2009/08/09/install-rspec#comments</comments>
		<pubDate>Sun, 09 Aug 2009 08:11:56 +0000</pubDate>
		<dc:creator>ikm</dc:creator>
				<category><![CDATA[未分類]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[rspec]]></category>

		<guid isPermaLink="false">http://aerial.st/?p=522</guid>
		<description><![CDATA[いつも忘れるのでメモ： $ ruby script/plugin install git://github.com/dchelimsky/rspec.git -r 'refs/tags/1.2.8' $ ruby script/plugin install git://github.com/dchelimsky/rspec-rails.git -r 'refs/tags/1.2.7.1' $ ruby script/generate rspec 追記 environment.rbでconfig.gemを設定してrake gems:installのが確実か。 config.gem "rspec", :lib => false, :version => "1.2.7" config.gem "rspec-rails", :lib => false, :version => "1.2.7.1"]]></description>
		<wfw:commentRss>http://aerial.st/archive/2009/08/09/install-rspec/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://aerial.st/archive/2009/08/09/install-rspec" />
	</item>
		<item>
		<title>Growlでautospecの結果を表示</title>
		<link>http://aerial.st/archive/2009/07/21/display-autospec-results-with-growl</link>
		<comments>http://aerial.st/archive/2009/07/21/display-autospec-results-with-growl#comments</comments>
		<pubDate>Mon, 20 Jul 2009 15:17:39 +0000</pubDate>
		<dc:creator>ikm</dc:creator>
				<category><![CDATA[開発]]></category>
		<category><![CDATA[growl]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[rspec]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://aerial.st/?p=493</guid>
		<description><![CDATA[Growlの準備 Growlをインストール インストーラと一緒に入っているExtra/growlnotify/install.shを実行する autotest + growl で楽々テストを参考に、Growlが「受信される通知を聞く」、「リモートアプリケーション登録を許可」するように環境設定パネルから設定する。 gem類の準備 バージョンも併記した。 まずはgemの準備。 $sudo gem install ZenTest # 4.1.1 $sudo gem install redgreen # 1.2.2, autospecの結果をコンソールで赤と緑で塗り分けてくれる。Growlだけなら不要 $sudo gem install ruby-growl # 1.0.1 RSpecとRSpec on Railsのインストール。 ruby script/plugin install git://github.com/dchelimsky/rspec.git -r 'refs/tags/1.2.7' # 1.2.7 ruby script/plugin install git://github.com/dchelimsky/rspec-rails.git -r 'refs/tags/1.2.7.1' # 1.2.7.1 ruby script/generate rspec 画像を拝借 cd ~ curl [...]]]></description>
		<wfw:commentRss>http://aerial.st/archive/2009/07/21/display-autospec-results-with-growl/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://aerial.st/archive/2009/07/21/display-autospec-results-with-growl" />
	</item>
	</channel>
</rss>
