-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--require spec_helper | ||
--format documentation |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
require 'spec_helper' | ||
|
||
describe 'Step01VariableTest' do | ||
context 'local variable' do | ||
# What string is sea variable at the method end? | ||
# メソッド終了時の変数 sea の中身は? | ||
it 'variable basic' do | ||
sea = 'mystic' | ||
log(sea) # your answer? => mystic | ||
end | ||
|
||
# Same as the previous method question. (前のメソッドの質問と同じ) | ||
it 'variable initial' do | ||
sea = 'mystic' | ||
land = 8.to_s | ||
piari = nil.to_s | ||
dstore = 'mal' | ||
sea = sea + land + piari + ':' + dstore | ||
log(sea) # your answer? => | ||
end | ||
|
||
# Same as the previous method question. (前のメソッドの質問と同じ) | ||
it 'variable reassigned basic' do | ||
sea = 'mystic' | ||
land = 'oneman' | ||
sea = land | ||
land = land + "'s dreams" | ||
log(sea) # your answer? => | ||
end | ||
|
||
# Same as the previous method question. (前のメソッドの質問と同じ) | ||
it 'variable reassigned int' do | ||
sea = 94 | ||
land = 415 | ||
sea = land | ||
land += 1 | ||
log(sea) # your answer? => | ||
end | ||
end | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module SpecHelper | ||
def log(messages) | ||
puts(messages) | ||
end | ||
end | ||
|
||
RSpec.configure do |config| | ||
config.include SpecHelper | ||
end |