teckel 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/spec/result_spec.rb DELETED
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'support/dry_base'
4
- require 'support/fake_models'
5
-
6
- module TeckelResultTest
7
- class MissingResultImplementation
8
- include Teckel::Result
9
- def initialize(value, success); end
10
- end
11
- end
12
-
13
- RSpec.describe Teckel::Result do
14
- describe "missing initialize" do
15
- specify "raises NotImplementedError" do
16
- result = TeckelResultTest::MissingResultImplementation["value", true]
17
- expect { result.successful? }.to raise_error(NotImplementedError, "Result object does not implement `successful?`")
18
- expect { result.failure? }.to raise_error(NotImplementedError, "Result object does not implement `successful?`")
19
- expect { result.value }.to raise_error(NotImplementedError, "Result object does not implement `value`")
20
- end
21
- end
22
- end
data/spec/spec_helper.rb DELETED
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/setup"
4
- if ENV['COVERAGE'] == 'true'
5
- require 'simplecov'
6
-
7
- SimpleCov.formatter = case ENV['SIMPLECOV']&.downcase
8
- when 'html'
9
- SimpleCov::Formatter::HTMLFormatter
10
- else
11
- require 'simplecov_json_formatter'
12
- SimpleCov::Formatter::JSONFormatter
13
- end
14
-
15
- SimpleCov.start do
16
- add_filter %r{^/spec/}
17
- end
18
- end
19
-
20
- require "teckel"
21
- require "teckel/chain"
22
-
23
- RSpec.configure do |config|
24
- # Enable flags like --only-failures and --next-failure
25
- config.example_status_persistence_file_path = ".rspec_status"
26
-
27
- # Disable RSpec exposing methods globally on `Module` and `main`
28
- config.disable_monkey_patching!
29
-
30
- config.formatter = config.files_to_run.size > 1 ? :progress : :documentation
31
-
32
- config.expect_with :rspec do |c|
33
- c.syntax = :expect
34
- end
35
- end
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'dry-types'
4
- require 'dry-struct'
5
-
6
- module Types
7
- include Dry.Types()
8
- end
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module FakeDB
4
- Rollback = Class.new(RuntimeError)
5
-
6
- def self.transaction
7
- yield
8
- rescue Rollback
9
- # doing rollback ...
10
- raise
11
- end
12
- end
@@ -1,20 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class User
4
- def initialize(name:, age:)
5
- @name, @age = name, age
6
- end
7
- attr_reader :name, :age
8
-
9
- def save
10
- !underage?
11
- end
12
-
13
- def errors
14
- underage? ? [{ age: "underage" }] : nil
15
- end
16
-
17
- def underage?
18
- @age <= 18
19
- end
20
- end
data/spec/teckel_spec.rb DELETED
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RSpec.describe Teckel do
4
- it "has a version number" do
5
- expect(Teckel::VERSION).not_to be nil
6
- end
7
- end