spec/lovelive/member_spec.rb in pebbles-lovelive-0.0.2 vs spec/lovelive/member_spec.rb in pebbles-lovelive-0.1.0

- old
+ new

@@ -15,13 +15,42 @@ expect(@members.size).to eq(9) end describe 'eli' do before { @eli = @members[:eli] } - subject { @eli } + subject(:eli) { @eli } - its(:name) { should == @eli.last_name + @eli.first_name } - its(:birth) { should == "#{@eli.birth_month}月#{@eli.birth_day}日" } - its(:three_size) { should == "B#{@eli.bust}・W#{@eli.waste}・H#{@eli.hip}" } + it "#name is full name" do + expect(eli.name).to eq(@eli.last_name + @eli.first_name) + end + + it "#birth is format of birthday" do + expect(eli.birth).to eq("#{@eli.birth_month}月#{@eli.birth_day}日") + end + + it "#three_size is format of three size" do + expect(eli.three_size).to eq("B#{@eli.bust}・W#{@eli.waste}・H#{@eli.hip}") + end + + describe "#print" do + it "show member profile" do + output = capture_stdout { @eli.print(false, false) } + expect(output).to include "名前: 絢瀬絵里" + end + + context "aa flag ture" do + it "show aa" do + output = capture_stdout { @eli.print(true, false) } + expect(output).to include "             , 、 , -‐- 、" + end + end + + context "big aa flag ture" do + it "show big aa" do + output = capture_stdout { @eli.print(false, true) } + expect(output).to include " .-+o/+o+-`. " + end + end + end end end end