Skip to content

Commit

Permalink
T-89: Set up Rubocop for RSpec (#86)
Browse files Browse the repository at this point in the history
* T-89: Set up Rubocop for RSpec

* T-89: Autocorrect specs

* T-89: Fix when issues

* T-89: Fix specs for Temperature#inspect

* T-89: Fix specs for Temperature#coerce

* T-89: Fix specs for Temperature#<=>

* T-89: Fix specs for Temperature#<=>

* T-89: Fix specs for Temperature#to_celsius, Temperature#to_fahrenheit, Temperature#to_kelvin, and Temperature#to_rankine

* T-89: Fix specs for Temperature#set_scale

* T-89: Lets for Temperature#<=>

* T-89: Lets for Temperature#set_degrees

* T-89: Fix specs for Temperature#inspect

* T-89: Fix specs for Temperature#coerce

* T-89: Fix specs for Temperature#==, and Temperature#<=>

* T-89: Lets for Temperature#==

* T-89: Fix specs for Temperature#set_scale

* T-89: Fix specs for Temperature#to_celsius, Temperature#to_fahrenheit, Temperature#to_kelvin, and Temperature#to_rankine

* T-89: Messages for errors

* T-89: Fix specs for Temperature#to_celsius, Temperature#to_fahrenheit, Temperature#to_kelvin, and Temperature#to_rankine

* T-89: Fix specs for Temperature#to_celsius, Temperature#to_fahrenheit, Temperature#to_kelvin, and Temperature#to_rankine

* T-89: Fix specs for Temperature.[]

* T-89: rename memoize methods descriptions

* T-89: rename tempeture to temperature

* T-89: TODO - Find a way to avoid deeply nested contexts

* T-89: Remove .with(0, celsius) until Ruby 3.0

* T-89: Remove enters from description

* T-89: Add and_call_original
  • Loading branch information
marian13 committed Feb 14, 2022
1 parent 6d80128 commit aa2c09e
Show file tree
Hide file tree
Showing 4 changed files with 335 additions and 267 deletions.
8 changes: 8 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
inherit_from:
- .rubocop_rspec.yml

##
# Standard based Rubocop config.
# - https://github.com/testdouble/standard
# - https://github.com/testdouble/standard#usage-via-rubocop
# - https://evilmartians.com/chronicles/rubocoping-with-legacy-bring-your-ruby-code-up-to-standard
#
require:
##
# Rubocop for RSpec files.
# https://github.com/rubocop/rubocop-rspec#usage
#
- rubocop-rspec
##
# NOTE: `rubocop-performance' is automatically bundled with Standard.
#
Expand Down
58 changes: 58 additions & 0 deletions .rubocop_rspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
##
# Standard based Rubocop config suggested by Evil Martians.
# - https://evilmartians.com/chronicles/rubocoping-with-legacy-bring-your-ruby-code-up-to-standard
# - https://github.com/testdouble/standard
#
# Copied without any modifications from:
# https://gist.github.com/palkan/623c0816b05ed246bfe0cb406050990a
#
require:
- rubocop-rspec

RSpec/Focus:
Enabled: true

RSpec/EmptyExampleGroup:
Enabled: true

RSpec/EmptyLineAfterExampleGroup:
Enabled: true

RSpec/EmptyLineAfterFinalLet:
Enabled: true

RSpec/EmptyLineAfterHook:
Enabled: true

RSpec/EmptyLineAfterSubject:
Enabled: true

RSpec/HookArgument:
Enabled: true

RSpec/HooksBeforeExamples:
Enabled: true

RSpec/ImplicitExpect:
Enabled: true

RSpec/IteratedExpectation:
Enabled: true

RSpec/LetBeforeExamples:
Enabled: true

RSpec/MissingExampleGroupArgument:
Enabled: true

RSpec/ReceiveCounts:
Enabled: true

RSpec/Capybara/CurrentPathExpectation:
Enabled: true

RSpec/FactoryBot/AttributeDefinedStatically:
Enabled: true

RSpec/FactoryBot/CreateList:
Enabled: true
1 change: 1 addition & 0 deletions basic_temperature.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "rerun"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "rubocop"
spec.add_development_dependency "rubocop-rspec"
spec.add_development_dependency "standard"
spec.add_development_dependency "sdoc"
spec.add_development_dependency "simplecov"
Expand Down
Loading

0 comments on commit aa2c09e

Please sign in to comment.