Skip to content

Commit

Permalink
Test on new Rubies, README updates
Browse files Browse the repository at this point in the history
- Fix link to Spanish version of the README
- Test file renames following expected format by editor
- Drop minitest reporters for nicer output within the editor
- On second exercise return zero instead of - to make the else branches
  differ more
  • Loading branch information
tute committed Apr 20, 2022
1 parent 49d501b commit 21b79a2
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: ruby
rvm:
- 2.4
- 2.5
- 2.7
- 3.0
- jruby-19mode
File renamed without changes.
2 changes: 1 addition & 1 deletion 2-special-case-objects/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def last_trial_days(user)
if user.last_subscription && user.last_subscription.respond_to?(:trial_days)
user.last_subscription.trial_days
else
'-'
'0'
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class TestApp < Minitest::Test
def test_status_report_job
response = {
"Bob" => { name: "Monthly Subscription", status: "active", trial_days: 14},
"Patricio" => { name: "none", status: "-", trial_days: "-"}
"Patricio" => { name: "none", status: "-", trial_days: "0"}
}
assert_equal response, StatusReportJob.new.perform
end
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ source 'https://rubygems.org'

gem 'rake'
gem 'minitest'
gem 'minitest-reporters'
14 changes: 12 additions & 2 deletions README.es.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Taller de Refactorización

Requerimientos: Ruby >= 2, git, bundler.
Requerimientos: Ruby >= 2.7, git, bundler.

Cada carpeta lleva por nombre el patrón de refactoring a practicar, y los
siguientes archivos:
Expand All @@ -9,7 +9,7 @@ siguientes archivos:
* `setup.rb` código de inicialización necesario para `app.rb` (sería el
"framework", o el resto de la aplicación). No necesitamos conocerlo o editarlo,
a no ser que sea por curiosidad.
* `tests.rb` el nombre lo explica. Necesarios para la vida, especialmente si
* `test_app.rb` el nombre lo explica. Necesarios para la vida, especialmente si
pensamos refactorizar.

Ejecutar `bundle` para asegurarse de tener las rubygems necesarias para correr
Expand Down Expand Up @@ -42,3 +42,13 @@ Nota de implementación: contiene dos archivos adicionales necesarios para los
tests: `fixtures/input.csv` y `fixtures/output.csv`, y no contiene `setup.rb`.

## 4. Service Object


# Slides

* [Slides (English)](https://github.com/tute/refactoring-workshop-slides-sep-2015/)
* [Slides (Español)](https://www.tutecosta.com/refactoring-workshop-slides-sep-2015/#/) [repo](https://github.com/tute/refactoring-workshop-slides-sep-2015/tree/es)

# In English

[English version of this doc available](https://github.com/tute/refactoring-workshop/blob/master/README.md).
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Refactoring Workshop

Requirements: Ruby >= 2.0, git, `minitest` gem.
Requirements: Ruby >= 2.7, git, `minitest` gem.

Each folder is named after the refactoring pattern they tackle, and contains:

* `app.rb` code we'll refactor.
* `setup.rb` necessary code for `app.rb` to run (mimicks a SUPER BASIC Rails)
We don't need to see/edit it unless just curious. :-)
* `tests.rb` self explanatory. Necessary for daily life, specially for
* `test_app.rb` self explanatory. Necessary for daily life, specially for
refactoring.

Run `bundle` to make sure you have the gems needed for running tests (`rake`
Expand Down Expand Up @@ -44,9 +44,9 @@ Implementation note: folder contains two fixture files needed for tests,

# Slides

* [RubyConf Argentina Slides](http://es.slideshare.net/thoughtbot/refactoring-workshop-rubyconf-argentina-2014)
* [RailsConf Slides](http://www.slideshare.net/tutec/simplifying-code-monster-to-elegant-in-n-5-steps)
* [Slides (English)](https://github.com/tute/refactoring-workshop-slides-sep-2015/)
* [Slides (Español)](https://www.tutecosta.com/refactoring-workshop-slides-sep-2015/#/) [repo](https://github.com/tute/refactoring-workshop-slides-sep-2015/tree/es)

# In Spanish

[Spanish version of this doc available](https://github.com/tute/refactoring-workshop/blob/master/README.md).
[Spanish version of this doc available](https://github.com/tute/refactoring-workshop/blob/master/README.es.md).
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require 'rake/testtask'

Rake::TestTask.new(:test) do |t|
t.libs = FileList['*-*/']
t.test_files = FileList['*/tests.rb']
t.test_files = FileList['*/test_*.rb']
end

task default: :test
2 changes: 0 additions & 2 deletions test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
require "minitest/autorun"
require "minitest/reporters"
Minitest::Reporters.use!

0 comments on commit 21b79a2

Please sign in to comment.