开发者

how not to create unit test file in rails3

开发者 https://www.devze.com 2023-01-22 19:40 出处:网络
rails g model GiftProduct -p --migration=false --fixture=false i tried this code,and it reduce some generate file but still can\'t find how to avoid unit test file genertate,
rails g model GiftProduct -p --migration=false --fixture=false

i tried this code,and it reduce some generate file but still can't find how to avoid unit test file genertate,

in fact i only want 开发者_JS百科a model file

i'm new on rail3,hope someone could help me below is the generate result

  invoke  active_record
  create    app/models/gift_product.rb
  invoke    test_unit
  create      test/unit/gift_product_test.rb


Works in Rails 3.2:

rails g model Foo --no-test-framework


try this

rails g model project  --no-tests --no-fixtures --no-migrations

I'm not only R3 yest so I'm not sure


You could try setting the test framework to nil or any non-existent test framework.

rails g model Test -t nil

Outputs

invoke  active_record
create    db/migrate/20101102025557_create_tests.rb
create    app/models/test.rb
 error    nil [not found]

Admittedly, not the nicest or most correct way of doing it, but it works.

0

精彩评论

暂无评论...
验证码 换一张
取 消