Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rakefile Best Practices (& RuboCop) #72

Merged
merged 10 commits into from
Dec 15, 2022
Prev Previous commit
Next Next commit
⬆️ Upgrade to RSpec 2.99
  • Loading branch information
pboling committed Dec 11, 2022
commit 400b76e35b42ba41144af2fec2acbdbdaebba4d3
4 changes: 4 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
--format documentation
--require spec_helper
--color
--order random
27 changes: 14 additions & 13 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -7,27 +7,28 @@ GEM
remote: http://rubygems.org/
specs:
diff-lcs (1.5.0)
power_assert (2.0.1)
power_assert (2.0.2)
rake (0.9.6)
rspec (2.5.0)
rspec-core (~> 2.5.0)
rspec-expectations (~> 2.5.0)
rspec-mocks (~> 2.5.0)
rspec-core (2.5.2)
rspec-expectations (2.5.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.5.0)
test-unit (3.2.3)
rspec (2.99.0)
rspec-core (~> 2.99.0)
rspec-expectations (~> 2.99.0)
rspec-mocks (~> 2.99.0)
rspec-core (2.99.2)
rspec-expectations (2.99.2)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.99.4)
test-unit (3.5.5)
power_assert

PLATFORMS
arm64-darwin-21
x86_64-darwin-19

DEPENDENCIES
os!
rake (~> 0.8)
rspec (~> 2.5.0)
test-unit (~> 3.2.0)
rspec (~> 2.99)
test-unit (~> 3.5)

BUNDLED WITH
2.3.13
2.3.26
12 changes: 6 additions & 6 deletions os.gemspec
Original file line number Diff line number Diff line change
@@ -47,17 +47,17 @@ Gem::Specification.new do |s|

if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_development_dependency(%q<rake>.freeze, ["~> 0.8"])
s.add_development_dependency(%q<test-unit>.freeze, ["~> 3.2.0"])
s.add_development_dependency(%q<rspec>.freeze, ["~> 2.5.0"])
s.add_development_dependency(%q<test-unit>.freeze, ["~> 3.5"])
s.add_development_dependency(%q<rspec>.freeze, ["~> 2.99"])
else
s.add_dependency(%q<rake>.freeze, ["~> 0.8"])
s.add_dependency(%q<test-unit>.freeze, ["~> 3.2.0"])
s.add_dependency(%q<rspec>.freeze, ["~> 2.5.0"])
s.add_dependency(%q<test-unit>.freeze, ["~> 3.5"])
s.add_dependency(%q<rspec>.freeze, ["~> 2.99"])
end
else
s.add_dependency(%q<rake>.freeze, ["~> 0.8"])
s.add_dependency(%q<test-unit>.freeze, ["~> 3.2.0"])
s.add_dependency(%q<rspec>.freeze, ["~> 2.5.0"])
s.add_dependency(%q<test-unit>.freeze, ["~> 3.5"])
s.add_dependency(%q<rspec>.freeze, ["~> 2.99"])
end
end

17 changes: 17 additions & 0 deletions spec/config/rspec/rspec_core.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true

RSpec.configure do |config|
# RSpec v3+
# Enable flags like --only-failures and --next-failure
# config.example_status_persistence_file_path = '.rspec_status'

# RSpec v3+
# Disable RSpec exposing methods globally on `Module` and `main`
# config.disable_monkey_patching!

config.expect_with :rspec do |c|
c.syntax = :should
end

config.expect_with :stdlib
end
5 changes: 0 additions & 5 deletions spec/linux_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
require 'rubygems' if RUBY_VERSION < '1.9.0'

require File.dirname(__FILE__) + '/../lib/os.rb' # load before sane to avoid sane being able to requir the gemified version...
require 'rspec' # rspec2

describe 'For Linux, (Ubuntu, Ubuntu 10.04 LTS) ' do
before(:each) do
ENV.should_receive(:[]).with('OS').any_number_of_times.and_return()
2 changes: 0 additions & 2 deletions spec/os_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
require File.expand_path('spec_helper.rb', File.dirname(__FILE__))

describe "OS" do

it "identifies whether windows? or posix?" do
2 changes: 0 additions & 2 deletions spec/osx_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
require File.expand_path('spec_helper.rb', File.dirname(__FILE__))

describe 'For OSX (Snow Leopard, 10.6),' do
before(:each) do
ENV.stub!(:[]).with('OS').and_return(nil)
14 changes: 7 additions & 7 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
require 'rubygems' if RUBY_VERSION < '1.9.0'
require File.expand_path('../lib/os.rb', File.dirname(__FILE__))
# Third Party Libraries
require 'rspec'

require 'rspec' # rspec2
require 'rspec/autorun'
# This gem
require 'os'

RSpec.configure do |config|
config.expect_with :rspec, :stdlib # enable `should` OR `assert`
end
# Library Configs

# RSpec Configs
require 'config/rspec/rspec_core'