简体   繁体   中英

Rspec wrong number of arguments (1 for 0)

I'm following a tutorial on Rspec from pluralsight.com. The tutorial gives the following code which works on the screencast:

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     

but when I run it I get the following error:

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

Spelling error:

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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