Minitest/spec に関するドキュメントがあまり見つからないように思われるので、誰かが私が何をする必要があるかを理解するのを手伝ってくれるかどうか疑問に思っていました. 基本的に、すべてのクラスとモジュールでテストを実行して、1.) 静的または 2.) の場合は正しい値の型を出力することを確認します。to_symbols の場合、すべてのキーはシンボルです。これが私がこれまでに試したことです:
ガーキンは次のようになると思います。
Given binns
When the version method is called
then the return should be a float
and version should be a method or constant
私が想定したのは、minitest/spec の場合:
require 'minitest/autorun'
require 'minitest/spec'
require 'binns'
given Binns do
when "the version method is called" do
then "the return should be a float" do
# Do work
end
end
end
しかし、私は得る:
syntax error, unexpected keyword_when (SyntaxError)
when "the version method is called" do
^
注: テストに関する他の提案も受け付けています (私はキュウリについてあまり詳しくなく、それは重いと聞きました)。誰かが本の提案を持っている場合は、Ruby ユニット テストに関する優れた本を探していることを教えてください。 .