From a3b54c495d8205215760d6951ec5bf66ae7c1869 Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Sun, 24 Aug 2014 20:55:36 +0900 Subject: [PATCH 1/5] Add Cure.peace.pikarin_janken (singleton method) --- lib/rubicure.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/rubicure.rb b/lib/rubicure.rb index 8825621..bf1b6b5 100644 --- a/lib/rubicure.rb +++ b/lib/rubicure.rb @@ -28,6 +28,18 @@ def self.method_missing(name, *args) super end end + + class << self.peace + MESSAGE = < Date: Sun, 24 Aug 2014 21:16:07 +0900 Subject: [PATCH 2/5] =?UTF-8?q?Add=20=E3=82=B0=E3=83=83=E3=83=81=E3=83=A7?= =?UTF-8?q?=E3=83=83=E3=83=91=E3=83=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/rubicure.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/rubicure.rb b/lib/rubicure.rb index bf1b6b5..e637768 100644 --- a/lib/rubicure.rb +++ b/lib/rubicure.rb @@ -30,13 +30,18 @@ def self.method_missing(name, *args) end class << self.peace + HANDS = + (%w(グー) * 13) + + (%w(チョキ) * 14) + + (%w(パー) * 15) + + %w(グッチョッパー) MESSAGE = < Date: Mon, 25 Aug 2014 02:40:24 +0900 Subject: [PATCH 3/5] Fix pikarin_janken (define each instance) --- lib/rubicure.rb | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/rubicure.rb b/lib/rubicure.rb index e637768..66d34a0 100644 --- a/lib/rubicure.rb +++ b/lib/rubicure.rb @@ -29,21 +29,23 @@ def self.method_missing(name, *args) end end - class << self.peace - HANDS = - (%w(グー) * 13) + - (%w(チョキ) * 14) + - (%w(パー) * 15) + - %w(グッチョッパー) - MESSAGE = < Date: Thu, 28 Aug 2014 19:50:18 +0900 Subject: [PATCH 4/5] Add spec for Cure::peace#pikarin_janken --- spec/girl_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/girl_spec.rb b/spec/girl_spec.rb index 370226f..4ffc919 100644 --- a/spec/girl_spec.rb +++ b/spec/girl_spec.rb @@ -157,4 +157,13 @@ it { expect{ subject }.to raise_error NoMethodError } end end + + describe "cure_peace#pikarin_janken" do + let(:girl){ Cure::peace } + + it do + expect(girl.pikarin_janken). + to match %r/ピカピカピカリン\nジャンケンポン!\n(.+)/ + end + end end From aed2b52d3b59053942c11231e949c98d67325049 Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Fri, 29 Aug 2014 00:16:58 +0900 Subject: [PATCH 5/5] Fix (class method call) --- spec/girl_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/girl_spec.rb b/spec/girl_spec.rb index 4ffc919..41bd634 100644 --- a/spec/girl_spec.rb +++ b/spec/girl_spec.rb @@ -159,7 +159,7 @@ end describe "cure_peace#pikarin_janken" do - let(:girl){ Cure::peace } + let(:girl){ Cure.peace } it do expect(girl.pikarin_janken).