[rspec-users] Problem while generating rspec model in Rails Project

David Chelimsky dchelimsky at gmail.com
Fri Jun 12 10:13:06 EDT 2009


On Fri, Jun 12, 2009 at 5:35 AM, Ninad Pol<lists at ruby-forum.com> wrote:
>
> Hi,
>
> I am new to testing and Rspec. I have one rails project created on my
> machine.
> In this project under \app\models i have a file called "client.rb" which
> has been already created. Now i want to generate spec file for this
> model for which i am using command:
>
> ruby script/generate rspec_model Client
>
> Now with this command along with spec file, a file called "client.rb"
> will also be generated under \app\models. But in my case since the file
> "client.rb" is already present,with above command i am getting following
> message:
>
> ---------------------------------------------------
>>ruby script/generate rspec_model Client
>
> The name 'Client' is either already used in your application or reserved
> by Ru
> by on Rails.
> Please choose an alternative and run this generator again.
>
> Suggestions:
>
> customer
> node
> guest
>
> ----------------------------------------------------
> Platform and Version details:
>
> Windows xp-professional
> Ruby 1.8.6
> Rails 2.3.2
> Gem 1.3.1
> ----------------------------------------------------
> I have also attached console snapshot for same.
>
> I haven't found any help related to this.Ideally in such cases it should
> ask for the message regarding "whether you want to overwrite file
> client.rb ? "
>
> So can anybody please help me out regarding this issue. whether this is
> related to version problem or what else earliest?

I'm not sure where this message is coming from but it's not coming
from rspec. Have you tried generating with the rails generator?

ruby script/generate model Client

Does that give you the same error?

>
> Attachments:
> http://www.ruby-forum.com/attachment/3812/rspec_model_generation.JPG


More information about the rspec-users mailing list