Skip to content

Commit

Permalink
feat: 🎸 外伝から料理長と軍医を例外的扱いとして除外した (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikukyugamer authored Jul 27, 2023
1 parent f185f02 commit 659e694
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/lib/constant/gss_character_names.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,19 @@ def s2
def gaiden
(
ProductTitle.find_by(name: '幻想水滸外伝Vol.1').gss_characters.pluck(:name) +
ProductTitle.find_by(name: '幻想水滸外伝Vol.2').gss_characters.pluck(:name)
ProductTitle.find_by(name: '幻想水滸外伝Vol.2').gss_characters.pluck(:name) -
gaiden_removed_character_names
).uniq.sort
end

# NOTE: この実装はあまり良くない
def gaiden_removed_character_names
%w[
軍医
料理長
]
end

def s3
ProductTitle.find_by(name: '幻想水滸伝III').gss_characters.pluck(:name).sort
end
Expand Down
12 changes: 12 additions & 0 deletions spec/lib/constant/gss_character_names_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@
expect(Constant::GssCharacterNames.gaiden.count).to be > 0
end

it '#gaiden に料理長が含まれていないこと' do
expect(Constant::GssCharacterNames.gaiden).not_to include('料理長')
end

it '#gaiden に軍医が含まれていないこと' do
expect(Constant::GssCharacterNames.gaiden).not_to include('料理長')
end

it '#gaiden にザジ・キュイロス(サナトス・クロフォード)が含まれていること' do
expect(Constant::GssCharacterNames.gaiden).to include('ザジ・キュイロス(サナトス・クロフォード)')
end

it '#s3 で値が返ってくること' do
expect(Constant::GssCharacterNames.s3.count).to be > 0
end
Expand Down

0 comments on commit 659e694

Please sign in to comment.