diff --git a/.gitignore b/.gitignore index 9106b2a..d6c01c4 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /pkg/ /spec/reports/ /tmp/ +/.rspec_status diff --git a/.rspec b/.rspec new file mode 100644 index 0000000..34c5164 --- /dev/null +++ b/.rspec @@ -0,0 +1,3 @@ +--format documentation +--color +--require spec_helper diff --git a/Gemfile.lock b/Gemfile.lock index f82aa41..e19ce84 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -6,7 +6,21 @@ PATH GEM remote: https://rubygems.org/ specs: + diff-lcs (1.4.4) rake (12.3.2) + rspec (3.10.0) + rspec-core (~> 3.10.0) + rspec-expectations (~> 3.10.0) + rspec-mocks (~> 3.10.0) + rspec-core (3.10.1) + rspec-support (~> 3.10.0) + rspec-expectations (3.10.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.10.0) + rspec-mocks (3.10.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.10.0) + rspec-support (3.10.2) PLATFORMS ruby @@ -14,6 +28,7 @@ PLATFORMS DEPENDENCIES imbecile! rake (~> 12.0) + rspec (~> 3.0) BUNDLED WITH 2.1.4 diff --git a/Rakefile b/Rakefile index 43022f7..b7e9ed5 100644 --- a/Rakefile +++ b/Rakefile @@ -1,2 +1,6 @@ require "bundler/gem_tasks" +require "rspec/core/rake_task" + +RSpec::Core::RakeTask.new(:spec) + task :default => :spec diff --git a/imbecile.gemspec b/imbecile.gemspec index 72ca074..59ceb58 100644 --- a/imbecile.gemspec +++ b/imbecile.gemspec @@ -26,4 +26,6 @@ Gem::Specification.new do |spec| spec.bindir = "exe" spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] + + spec.add_development_dependency "rspec", "~> 3.0" end diff --git a/spec/imbecile_spec.rb b/spec/imbecile_spec.rb new file mode 100644 index 0000000..914c2ad --- /dev/null +++ b/spec/imbecile_spec.rb @@ -0,0 +1,5 @@ +RSpec.describe Imbecile do + it "has a version number" do + expect(Imbecile::VERSION).not_to be nil + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..f772d77 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,14 @@ +require "bundler/setup" +require "imbecile" + +RSpec.configure do |config| + # Enable flags like --only-failures and --next-failure + config.example_status_persistence_file_path = ".rspec_status" + + # Disable RSpec exposing methods globally on `Module` and `main` + config.disable_monkey_patching! + + config.expect_with :rspec do |c| + c.syntax = :expect + end +end