diff --git a/Gemfile b/Gemfile index 3f64f64..22ddabc 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source 'https://rubygems.org' gemspec -gem 'minitest' -gem 'rake' gem 'coveralls', require: false +gem 'rake' +gem 'rspec' gem 'rubocop' diff --git a/Rakefile b/Rakefile index 7939225..cdb2149 100644 --- a/Rakefile +++ b/Rakefile @@ -1,11 +1,11 @@ # encoding: utf-8 -require 'rake/testtask' require 'rubocop/rake_task' +require 'rspec/core/rake_task' -Rake::TestTask.new do |t| - t.libs = %w( lib test ) - t.test_files = FileList['test/**/test_*.rb', 'test/**/*_spec.rb'] +RSpec::Core::RakeTask.new(:spec) do |t| + t.rspec_opts = '-r ./spec/spec_helper.rb --color' + t.verbose = false end RuboCop::RakeTask.new(:rubocop) do |task| @@ -13,4 +13,4 @@ RuboCop::RakeTask.new(:rubocop) do |task| task.patterns = ['lib/**/*.rb', 'test/**/*.rb'] end -task :default => [:test, :rubocop] +task :default => [:spec, :rubocop] diff --git a/spec/filter_spec.rb b/spec/filter_spec.rb new file mode 100644 index 0000000..fa2d8f2 --- /dev/null +++ b/spec/filter_spec.rb @@ -0,0 +1,7 @@ +describe Nanoc::Asciidoctor::Filter do + let(:filter) { described_class.new } + + subject { filter.setup_and_run('== Blah blah') } + + it { is_expected.to match(%r{

Blah blah

}) } +end diff --git a/test/helper.rb b/spec/spec_helper.rb similarity index 63% rename from test/helper.rb rename to spec/spec_helper.rb index 04e3e54..85f4f21 100644 --- a/test/helper.rb +++ b/spec/spec_helper.rb @@ -1,7 +1,5 @@ require 'coveralls' Coveralls.wear! -require 'minitest' -require 'minitest/autorun' require 'nanoc' require 'nanoc-asciidoctor' diff --git a/test/filters/test_asciidoctor.rb b/test/filters/test_asciidoctor.rb deleted file mode 100644 index 7b03d0e..0000000 --- a/test/filters/test_asciidoctor.rb +++ /dev/null @@ -1,13 +0,0 @@ -require 'helper' - -module Nanoc - module Asciidoctor - class FilterTest < Minitest::Test - def test_filter - filter = ::Nanoc::Asciidoctor::Filter.new - result = filter.setup_and_run('== Blah blah') - assert_match %r{

Blah blah

}, result - end - end - end -end