Skip to content

Commit

Permalink
add challenge test
Browse files Browse the repository at this point in the history
  • Loading branch information
decoch committed Nov 2, 2019
1 parent fc64a9c commit f517069
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions spec/basic/step02_if_for_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,42 @@
log(str) # your answer? =>
end
end

context 'challenge' do
# Make list containing "a" from array of stage_array and show it as log by loop. (without select method)
# (stage_arrayの配列から "a" が含まれているものだけの配列を作成して、それをループで回してログに表示しましょう。(selectはなしで))
it 'test if for making' do
# write if-for here
end
end

context 'Good Luck' do
# Change for statement to Array's each (keep result after fix)
# (for文をeachメソッドへの置き換えてみましょう (修正前と修正後で実行結果が同じになるように))
it 'test if for refactor for to each' do
sea = nil
for stage in stage_array do
if stage.start_with?('br')
next
end
sea = stage
if stage.include?('ga')
break
end
end
log(sea) # your answer? =>
end

# Make your original exercise as question style about if-for statement.
# (if文for文についてあなたのオリジナルの質問形式のエクササイズを作ってみましょう)
#
# _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
# your question here (ここにあなたの質問を):
#
#_/_/_/_/_/_/_/_/_/_/
it 'test if for your exercise' do
# write your code here
end
end
end

0 comments on commit f517069

Please sign in to comment.