spec/spec_helper.rb in patch_ruby-1.2.4 vs spec/spec_helper.rb in patch_ruby-1.2.5
- old
+ new
@@ -11,11 +11,15 @@
=end
# load the gem
require 'patch_ruby'
require 'constants'
+require 'factory_bot'
+# Require shared spec examples
+Dir["./spec/support/**/*.rb"].sort.each { |f| require f }
+
# The following was generated by the `rspec --init` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# The generated `.rspec` file contains `--require spec_helper` which will cause
# this file to always be loaded, without a need to explicitly require it in any
# files.
@@ -31,9 +35,15 @@
# The `.rspec` file also contains a few flags that are not defaults but that
# users commonly want.
#
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
RSpec.configure do |config|
+ # Use FactoryBot for test factories
+ config.include FactoryBot::Syntax::Methods
+ config.before(:suite) do
+ FactoryBot.find_definitions
+ end
+
# rspec-expectations config goes here. You can use an alternate
# assertion/expectation library such as wrong or the stdlib/minitest
# assertions if you prefer.
config.expect_with :rspec do |expectations|
# This option will default to `true` in RSpec 4. It makes the `description`