質問編集履歴
1
文の修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -47,35 +47,50 @@
|
|
47
47
|
require '../lib/ticket'
|
48
48
|
|
49
49
|
class GateTest < Minitest::Test
|
50
|
-
def
|
50
|
+
def test_gate
|
51
51
|
umeda = Gate.new(:umeda)
|
52
52
|
juso = Gate.new(:juso)
|
53
53
|
|
54
54
|
ticket = Ticket.new(150)
|
55
55
|
umeda.enter(ticket)
|
56
|
-
|
56
|
+
assert juso.exit(ticket)
|
57
57
|
end
|
58
|
+
|
59
|
+
def test_umeda_to_mikuni_when_fare_is_not_enough
|
60
|
+
umeda = Gate.new(:umeda)
|
61
|
+
mikuni = Gate.new(:mikuni)
|
62
|
+
|
63
|
+
ticket = Ticket.new(150)
|
64
|
+
umeda.enter(ticket)
|
65
|
+
refute mikuni.exit(ticket)
|
66
|
+
end
|
58
67
|
end
|
59
68
|
```
|
60
69
|
↑これを保存しました。
|
61
70
|
|
62
71
|
その後、test_gateファイルをコマンドフロンプト上で実行したら、
|
63
72
|
|
64
|
-
|
73
|
+
un options: --seed 12011
|
65
74
|
|
66
75
|
# Running:
|
67
76
|
|
68
|
-
|
77
|
+
EE
|
69
78
|
|
70
|
-
Finished in 0.
|
79
|
+
Finished in 0.003171s, 630.6363 runs/s, 0.0000 assertions/s.
|
71
80
|
|
72
81
|
1) Error:
|
82
|
+
GateTest#test_gate:
|
83
|
+
NoMethodError: undefined method `stamp' for #<Ticket:0x000001c9a6087db8 @fare=150>
|
84
|
+
C:/Users/???/OneDrive/ドキュメント/furiRuby/lib/gate.rb:8:in `enter'
|
85
|
+
test_gate.rb:11:in `test_gate'
|
86
|
+
|
87
|
+
2) Error:
|
73
88
|
GateTest#test_umeda_to_mikuni_when_fare_is_not_enough:
|
74
|
-
NoMethodError: undefined method `stamp' for #<Ticket:
|
89
|
+
NoMethodError: undefined method `stamp' for #<Ticket:0x000001c9a6014570 @fare=150>
|
75
90
|
C:/Users/???/OneDrive/ドキュメント/furiRuby/lib/gate.rb:8:in `enter'
|
76
|
-
test_gate.rb:
|
91
|
+
test_gate.rb:20:in `test_umeda_to_mikuni_when_fare_is_not_enough'
|
77
92
|
|
78
|
-
|
93
|
+
2 runs, 0 assertions, 0 failures, 2 errors, 0 skips
|
79
94
|
|
80
95
|
このようなエラー表示が出ました。
|
81
96
|
|