Created
February 23, 2013 06:17
-
-
Save ohta-rh/5018680 to your computer and use it in GitHub Desktop.
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
#coding: utf-8 | |
require "rubygems" | |
require "rspec" | |
require "./step1" | |
describe Hoge do | |
describe :initialize do | |
subject { Hoge.new( 100, 1000) } | |
it "インスタンス変数aに100が代入されること" do | |
subject.a.should == 100 | |
end | |
it "インスタンス変数bに1000が代入されること" do | |
subject.b.should == 1000 | |
end | |
end | |
describe :calc do | |
context "aが50でbが72の場合" do | |
subject { Hoge.new(50,72) } | |
it "計算結果が122になること" do | |
subject.calc.should == 122 | |
end | |
end | |
context "aが100でbが32の場合" do | |
subject { Hoge.new( 100, 32 ) } | |
it "計算結果が132になること" do | |
subject.calc.should == 132 | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment