title: Rspec testing, ArgumentError: wrong number of arguments (0 for 1)
body: <p>I'm having trouble running a test using <code>rspec</code>. In my <code>book.rb</code> file the code block passes all the tests given to it for capitalizing words in the titles of books ("to kill a mockingbird", "inferno"). However, when I run rake from the terminal I am repeatedly getting the error message </p>
  
  <pre><code>"Failure/Error: @book.title.should == "Inferno"
       ArgumentError:
         wrong number of arguments (0 for 1)". 
  </code></pre>
  
  <p>I've tried changing the params and removing the title method but nothing works, I still get the error message even though the program capitalizes the titles as it should. Thanks, any help is greatly appreciated!</p>
  
  <pre><code>class Book
    attr_accessor :title, :littlewords
  
    def initialize
      @littlewords = ["the", "a", "an", "and", "of", "in"]
    end
  
    def title
      @title 
    end
  
    def title(lit)
      @title = ''
      books = lit.split
      books.each do |title|
        title.capitalize! unless (littlewords.to_s).include?(title)
      end
  
      books[0] = books[0].upcase
      books.first.capitalize!
      books.join(' ')
    end
  end
  
  s = Book.new
  puts s.title("to kill a mockingbird")
  puts s.title("inferno")
  </code></pre>