spec/spec_helper.rb in ffi-gdal-1.0.0.beta5 vs spec/spec_helper.rb in ffi-gdal-1.0.0.beta6
- old
+ new
@@ -7,13 +7,13 @@
add_group 'ext', 'lib/ext'
end
$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
require 'ffi-gdal'
+require 'byebug'
-require './spec/support/shared_contexts'
-Dir['./spec/support/shared_examples/**/*.rb'].sort.each { |f| require f }
+Dir['./spec/support/**/*.rb'].sort.each { |f| require f }
# This file 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.
@@ -79,17 +79,17 @@
# individual spec file.
if config.files_to_run.one?
# Use the documentation formatter for detailed output,
# unless a formatter has already been configured
# (e.g. via a command-line flag).
- # config.default_formatter = 'doc'
+ config.default_formatter = 'doc'
end
# Print the 10 slowest examples and example groups at the
# end of the spec run, to help surface which specs are running
# particularly slow.
- config.profile_examples = 3
+ config.profile_examples = 10
# Run specs in random order to surface order dependencies. If you find an
# order dependency and want to debug it, you can fix the order by providing
# the seed, which is printed after each run.
# --seed 1234
@@ -98,8 +98,17 @@
# Seed global randomization in this process using the `--seed` CLI option.
# Setting this allows you to use `--seed` to deterministically reproduce
# test failures related to randomization by passing the same `--seed` value
# as the one that triggered the failure.
Kernel.srand config.seed
-end
-GDAL::Logger.logging_enabled = true
+ config.include IntegrationHelp, type: :integration
+
+ config.before do
+ ::FFI::GDAL::GDAL.GDALAllRegister
+ Dir[File.join('tmp', '*')].each { |f| File.unlink(f) if File.exist?(f) }
+ end
+
+ config.after(:example, type: :integration) do
+ cleanup_test_files
+ end
+end