RR (Double Ruby、ダブルRuby)は、豊富なダブル化技術と簡潔な文法を備えたテストダブルフレームワークです。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Greeter | |
def initialize(time_proc = -> { Time.now.strftime("%H:%M:%S") }) | |
@time_proc = time_proc | |
end | |
def greet | |
time = @time_proc.call | |
if '05:00:00' <= time && time < '12:00:00' | |
'おはようございます' | |
elsif '12:00:00' <= time && time < '18:00:00' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
context '納品書から' do | |
context '請求書を変換する場合' do | |
before do | |
@user = FactoryGirl.create(:user) do |u| | |
u.sender.bank_accounts.create(detail: 'Foo Bank') | |
end | |
end | |
it '請求元の銀行口座の情報をコピーする' do | |
invoice = described_class.from(@user.delivery_slips.first).to(:invoice) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ gdb $HOME/.rbenv/versions/1.9.3-debug/bin/ruby /cores/core.65588 | |
GNU gdb 6.3.50-20050815 (Apple version gdb-1822) (Sun Aug 5 03:00:42 UTC 2012) | |
Copyright 2004 Free Software Foundation, Inc. | |
GDB is free software, covered by the GNU General Public License, and you are | |
welcome to change it and/or distribute copies of it under certain conditions. | |
Type "show copying" to see the conditions. | |
There is absolutely no warranty for GDB. Type "show warranty" for details. | |
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries ... done | |
Reading symbols for shared libraries . done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
**RRの紹介** | |
ダブル Ruby の省略である RR という名前の新しいテストダブルフレームワークを紹介できてうれしく思います。 | |
テストダブルは、[ダブルの説明]です。テストダブルについての詳細を http://xunitpatterns.com/Test%20Double.html で読むことができます。 | |
RR は次の構成をサポートしています: | |
* Mock | |
* Stub | |
* instance_of | |
* Probe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" > | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> | |
<title>SWFUpload v2 文書</title> | |
</head> | |
<style type="text/css"> | |
h1 /* Title */ { | |
} |
NewerOlder