我在下面收到错误消息
$ bundle exec rspec calculatorcli_spec.rb
Failure/Error: c = CalculatorCLI.parse
NoMethodError:
undefined method `parse' for CalculatorCLI:Class
来自下面的简单计算器类
答案 0 :(得分:0)
CalculatorCLI
是一个类,并且您缺少其初始化
将CalculatorCLI.parse
更改为CalculatorCLI.new.parse or change
def解析to
def self.parse in
CalculatorCLI`定义