Add rspec

This commit is contained in:
Josh Holtrop 2021-05-07 15:16:01 -04:00
parent b8c01ca1d1
commit 60adffbbab
7 changed files with 44 additions and 0 deletions

1
.gitignore vendored
View File

@ -6,3 +6,4 @@
/pkg/
/spec/reports/
/tmp/
/.rspec_status

3
.rspec Normal file
View File

@ -0,0 +1,3 @@
--format documentation
--color
--require spec_helper

View File

@ -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

View File

@ -1,2 +1,6 @@
require "bundler/gem_tasks"
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)
task :default => :spec

View File

@ -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

5
spec/imbecile_spec.rb Normal file
View File

@ -0,0 +1,5 @@
RSpec.describe Imbecile do
it "has a version number" do
expect(Imbecile::VERSION).not_to be nil
end
end

14
spec/spec_helper.rb Normal file
View File

@ -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