Skip to content

Commit

Permalink
Add default rake test task and setup for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuzanna Stolińska committed Apr 18, 2017
1 parent 2eb3a7b commit c9b5abc
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 63 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
.bundle/
log/*.log
test/dummy/tmp/
test/dummy/db/*.sqlite3
test/dummy/db/*.sqlite3-journal
test/dummy/log/*.log
swagger_ui_engine-*.gem

test/dummy/log/test.log
13 changes: 13 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,23 @@ end

require 'rdoc/task'

load 'rails/tasks/statistics.rake'
require 'bundler/gem_tasks'
require 'rake/testtask'

Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.libs << 'test'
t.pattern = 'test/**/*_test.rb'
t.verbose = false
end

RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'SwaggerUiEngine'
rdoc.options << '--line-numbers'
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('lib/**/*.rb')
end

task default: :test
63 changes: 0 additions & 63 deletions test/dummy/log/test.log

This file was deleted.

17 changes: 17 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Configure Rails Environment
ENV['RAILS_ENV'] = 'test'

require File.expand_path('../../test/dummy/config/environment.rb', __FILE__)
require 'rails/test_help'

# Filter out Minitest backtrace while allowing backtrace from other libraries
# to be shown.
Minitest.backtrace_filter = Minitest::BacktraceFilter.new

# Load fixtures from the engine
if ActiveSupport::TestCase.respond_to?(:fixture_path=)
ActiveSupport::TestCase.fixture_path = File.expand_path('../fixtures', __FILE__)
ActionDispatch::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path
ActiveSupport::TestCase.file_fixture_path = ActiveSupport::TestCase.fixture_path + '/files'
ActiveSupport::TestCase.fixtures :all
end

0 comments on commit c9b5abc

Please sign in to comment.