Skip to content

Commit

Permalink
feat(Defi): remove code isolation option
Browse files Browse the repository at this point in the history
  • Loading branch information
cyril committed Jan 25, 2024
1 parent f2edea1 commit 23b4262
Show file tree
Hide file tree
Showing 18 changed files with 72 additions and 143 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Ruby

on: [push]

jobs:
Expand All @@ -8,8 +9,6 @@ jobs:
strategy:
matrix:
ruby:
- 3.0
- 3.1
- 3.2
- 3.3
- head
Expand All @@ -21,5 +20,6 @@ jobs:
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run the default task
run: bundle exec rake

- name: Run the test task
run: bundle exec rake test
4 changes: 3 additions & 1 deletion .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: RuboCop

on: [push]

jobs:
Expand All @@ -9,7 +10,8 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
ruby-version: 3.2
bundler-cache: true

- name: Run the RuboCop task
run: bundle exec rake rubocop
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AllCops:
NewCops: enable
TargetRubyVersion: 3.0
TargetRubyVersion: 3.2

Exclude:
- '**/*.md'
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.6
3.2.3
34 changes: 16 additions & 18 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,37 +1,35 @@
PATH
remote: .
specs:
fix (1.0.0.beta8)
defi (~> 2.0.6)
matchi (~> 3.3.0)
spectus (~> 4.0.3)
fix (1.0.0.beta9)
defi (~> 3.0.0)
matchi (~> 3.3.2)
spectus (~> 5.0.0)

GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
aw (0.2.0)
defi (2.0.7)
aw (~> 0.2.0)
defi (3.0.0)
docile (1.4.0)
expresenter (1.4.0)
expresenter (1.4.1)
json (2.7.1)
language_server-protocol (3.17.0.3)
matchi (3.3.1)
matchi (3.3.2)
parallel (1.24.0)
parser (3.3.0.2)
parser (3.3.0.5)
ast (~> 2.4.1)
racc
racc (1.7.3)
rainbow (3.1.1)
rake (13.1.0)
regexp_parser (2.9.0)
rexml (3.2.6)
rubocop (1.59.0)
rubocop (1.60.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.4)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
Expand All @@ -56,11 +54,11 @@ GEM
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
spectus (4.0.3)
expresenter (~> 1.4.0)
test_tube (~> 2.1.1)
test_tube (2.1.3)
defi (~> 2.0.6)
spectus (5.0.0)
expresenter (~> 1.4.1)
test_tube (~> 3.0.0)
test_tube (3.0.0)
defi (~> 3.0.0)
unicode-display_width (2.5.0)
yard (0.9.34)

Expand All @@ -79,4 +77,4 @@ DEPENDENCIES
yard

BUNDLED WITH
2.3.19
2.5.5
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
Add to your Gemfile:

```ruby
gem "fix", ">= 1.0.0.beta8"
gem "fix", ">= 1.0.0.beta9"
```

Then execute:

```sh
bundle
bundle install
```

Or install it yourself:
Expand Down Expand Up @@ -119,15 +119,17 @@ Expected output:

## Versioning

Fix follows [Semantic Versioning 2.0](https://semver.org/).
__Fix__ follows [Semantic Versioning 2.0](https://semver.org/).

## License

Available under the [MIT License](https://github.com/fixrb/fix/raw/main/LICENSE.md).
The [gem](https://rubygems.org/gems/fix) is available as open source under the terms of the [MIT License](https://github.com/fixrb/fix/raw/main/LICENSE.md).

## Sponsorship
---

Sponsored by [Sashité](https://github.com/sashite/):

![Sashité logo - Dark Mode](https://github.com/fixrb/fix/raw/main/img/sponsor/dark/en/sashite.png#gh-dark-mode-only "Sashité")
![Sashité logo - Light Mode](https://github.com/fixrb/fix/raw/main/img/sponsor/light/en/sashite.png#gh-light-mode-only "Sashité")
<p>
This project is sponsored by:<br />
<a href="https://sashite.com/"><img
src="https://github.com/fixrb/fix/raw/main/img/sashite.png"
alt="Sashité" /></a>
</p>
2 changes: 1 addition & 1 deletion VERSION.semver
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0.beta8
1.0.0.beta9
20 changes: 11 additions & 9 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
Add to your Gemfile:

```ruby
gem "fix", ">= 1.0.0.beta8"
gem "fix", ">= 1.0.0.beta9"
```

Then execute:

```sh
bundle
bundle install
```

Or install it yourself:
Expand Down Expand Up @@ -119,15 +119,17 @@ Expected output:

## Versioning

Fix follows [Semantic Versioning 2.0](https://semver.org/).
__Fix__ follows [Semantic Versioning 2.0](https://semver.org/).

## License

Available under the [MIT License](https://github.com/fixrb/fix/raw/main/LICENSE.md).
The [gem](https://rubygems.org/gems/fix) is available as open source under the terms of the [MIT License](https://github.com/fixrb/fix/raw/main/LICENSE.md).

## Sponsorship
---

Sponsored by [Sashité](https://github.com/sashite/):

![Sashité logo - Dark Mode](https://github.com/fixrb/fix/raw/main/img/sponsor/dark/en/sashite.png#gh-dark-mode-only "Sashité")
![Sashité logo - Light Mode](https://github.com/fixrb/fix/raw/main/img/sponsor/light/en/sashite.png#gh-light-mode-only "Sashité")
<p>
This project is sponsored by:<br />
<a href="https://sashite.com/"><img
src="https://github.com/fixrb/fix/raw/main/img/sashite.png"
alt="Sashité" /></a>
</p>
8 changes: 4 additions & 4 deletions fix.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
spec.license = "MIT"
spec.files = Dir["LICENSE.md", "README.md", "lib/**/*"]

spec.required_ruby_version = ">= 3.0.0"
spec.required_ruby_version = ">= 3.2.0"

spec.metadata = {
"bug_tracker_uri" => "https://github.com/fixrb/fix/issues",
Expand All @@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
"rubygems_mfa_required" => "true"
}

spec.add_dependency "defi", "~> 2.0.6"
spec.add_dependency "matchi", "~> 3.3.0"
spec.add_dependency "spectus", "~> 4.0.3"
spec.add_dependency "defi", "~> 3.0.0"
spec.add_dependency "matchi", "~> 3.3.2"
spec.add_dependency "spectus", "~> 5.0.0"
end
Binary file added img/sashite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed img/sponsor/dark/en/sashite.png
Binary file not shown.
Binary file removed img/sponsor/light/en/sashite.png
Binary file not shown.
14 changes: 7 additions & 7 deletions lib/fix/dsl.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

require "defi"
require "defi/method"

require_relative "matcher"
require_relative "requirement"
Expand Down Expand Up @@ -28,8 +28,8 @@ class Dsl
# @return [Symbol] A private method that define the block content.
#
# @api public
def self.let(name, &block)
private define_method(name, &block)
def self.let(name, &)
private define_method(name, &)
end

# Defines an example group with user-defined properties that describes a
Expand All @@ -48,11 +48,11 @@ def self.let(name, &block)
# @param block [Proc] The block to define the specs.
#
# @api public
def self.with(**kwargs, &block)
def self.with(**kwargs, &)
klass = ::Class.new(self)
klass.const_get(:CONTEXTS) << klass
kwargs.each { |name, value| klass.let(name) { value } }
klass.instance_eval(&block)
klass.instance_eval(&)
klass
end

Expand All @@ -78,7 +78,7 @@ def self.on(method_name, *args, **kwargs, &block)
const_set(:"Child#{block.object_id}", klass)

klass.define_singleton_method(:challenges) do
challenge = ::Defi.send(method_name, *args, **kwargs)
challenge = ::Defi::Method.new(method_name, *args, **kwargs)
super() + [challenge]
end

Expand All @@ -105,7 +105,7 @@ def self.it(requirement)

# The list of challenges to be addressed to the object to be tested.
#
# @return [Array<Defi::Challenge>] A list of challenges.
# @return [Array<Defi::Method>] A list of challenges.
def self.challenges
[]
end
Expand Down
4 changes: 2 additions & 2 deletions lib/fix/matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ def change(object, method, ...)
# @return [#matches?] A satisfy matcher.
#
# @api public
def satisfy(&expected)
::Matchi::Satisfy.new(&expected)
def satisfy(&)
::Matchi::Satisfy.new(&)
end

private
Expand Down
Loading

0 comments on commit 23b4262

Please sign in to comment.