teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

文の修正

2021/08/03 15:53

投稿

退会済みユーザー
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 test_umeda_to_mikuni_when_fare_is_not_enough
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
- refute juso.exit(ticket)
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
- Run options: --seed 57778
73
+ un options: --seed 12011
65
74
 
66
75
  # Running:
67
76
 
68
- E
77
+ EE
69
78
 
70
- Finished in 0.002319s, 431.2204 runs/s, 0.0000 assertions/s.
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:0x000001c648fe0488 @fare=150>
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:11:in `test_umeda_to_mikuni_when_fare_is_not_enough'
91
+ test_gate.rb:20:in `test_umeda_to_mikuni_when_fare_is_not_enough'
77
92
 
78
- 1 runs, 0 assertions, 0 failures, 1 errors, 0 skips
93
+ 2 runs, 0 assertions, 0 failures, 2 errors, 0 skips
79
94
 
80
95
  このようなエラー表示が出ました。
81
96