Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
serradura committed Dec 7, 2023
1 parent 4df8f64 commit 348dbb5
Show file tree
Hide file tree
Showing 16 changed files with 795 additions and 122 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,18 @@ jobs:
name: Ruby ${{ matrix.ruby }}
strategy:
matrix:
ruby:
- '3.2.2'
- '3.1.4'
- '3.0.6'
- '2.7.8'

ruby: [2.7, 3.0, 3.1, 3.2, head]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run the default task
run: bundle exec rake
- name: Run the steep check
- name: Run base tests (Minitest)
run: bundle exec rake test
- name: Run static code analysis (Rubocop)
run: bundle exec rake rubocop
- name: Run static type checking (Steep)
run: bundle exec steep check
if: ${{ matrix.ruby == 3.2 }}
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ Minitest/MultipleAssertions:
Minitest/AssertEmptyLiteral:
Enabled: false

Minitest/AssertOperator:
Enabled: false

Naming/FileName:
Exclude:
- lib/bcdd-result.rb
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
## [Unreleased]

```ruby
BCDD::Result.configuration do |config|
config.addon.enable!(:continue)

config.constant_alias.enable!('Result')

config.pattern_matching.disable!(:nil_as_valid_value_checking)

config.feature.disable!(:expectations) if ::Rails.env.production?
end

extend BCDD::Result::Expectations.mixin(
config: {
addon: { continue: false },
pattern_matching: { nil_as_valid_value_checking: true },
},
success: {
numbers: ->(value) { value => [Numeric, Numeric] },
division_completed: Numeric
},
failure: {
invalid_arg: String,
division_by_zero: String
}
)
```

### Added

- Add `BCDD::Result.config`
Expand Down
10 changes: 5 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ source 'https://rubygems.org'
# Specify your gem's dependencies in bcdd-result.gemspec
gemspec

gem 'rake', '~> 13.0'
gem 'rake', '~> 13.1'

gem 'minitest', '~> 5.0'
gem 'minitest', '~> 5.20'

gem 'rubocop', '~> 1.21'
gem 'rubocop-minitest', '~> 0.31.1'
gem 'rubocop', '~> 1.58', '>= 1.58.0'
gem 'rubocop-minitest', '~> 0.33.0'
gem 'rubocop-performance', '~> 1.19', '>= 1.19.1'
gem 'rubocop-rake', '~> 0.6.0'

gem 'simplecov', '~> 0.22.0', require: false

gem 'steep', '~> 1.5', '>= 1.5.3', require: false
gem 'steep', '~> 1.6', require: false if RUBY_VERSION >= '3.0'
Loading

0 comments on commit 348dbb5

Please sign in to comment.