繁体   English   中英

Rspec错误的参数数量(1代表0)

[英]Rspec wrong number of arguments (1 for 0)

我正在关注来自pluralsight.com的Rspec教程。 本教程提供了以下代码,可以在截屏中使用:

module Wordpress
  module Comments
    class Client
      def intitialize(url)

      end
    end
  end
end

describe Wordpress::Comments::Client do
  it "stores a URL" do
    client = Wordpress::Comments::Client.new("http://mashable.com/comments/feed")
  end
end     

但是当我运行它时,出现以下错误:

Failure/Error: client = Wordpress::Comments::Client.new("http://mashable.com/comments/feed")
 ArgumentError:
   wrong number of arguments (1 for 0)

拼写错误:

module Wordpress
  module Comments
    class Client
      def initialize(url)
        ...         
      end
    end
  end
end

看起来像错字: initialize ,不是intitialize

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM