私はapp/config/lib
にあるテストを実行しようとしていますが、RSpecのテストを見つけることができません。RSpecを設定してlibフォルダの仕様を見つけるには?私はこのチュートリアル<a href="http://apionrails.icalialabs.com/book/frontmatter" rel="nofollow">http://apionrails.icalialabs.com/book/frontmatter</a></p> <p>次のRails 5.0と少しAPIを作成してい
私はconfig.autoload_paths << Rails.root.join('lib')
または config.autoload_paths += %W(#{config.root}/lib)
からapp/config/application.rb
を追加しようとしました。
これは私のコードです:
$ /app/config/application.rb
#required files go here, deleted for clarity.
Bundler.require(*Rails.groups)
module MarketPlaceApi
class Application < Rails::Application
# don't generate RSpec tests for views and helpers
config.generators do |g|
g.test_framework :rspec, fixture: true
g.fixture_replacement :factory_girl, dir: 'spec/factories'
g.view_specs false
g.helper_specs false
g.stylesheets = false
g.javascripts = false
g.helper = false
end
config.autoload_paths += %W(#{config.root}/lib)
end
end
テスト
$ app/config/lib/spec/test_spec.rb
require 'spec_helper'
describe ApiConstraints do
#test goes here
end
RSpecのは、それに位置テストを実行しますので、どのように私はlib
フォルダを追加することができますか?
ありがとうございます。