Skip to content

Releases: dry-rb/dry-monads

v1.10.0

24 Apr 01:35
v1.10.0
21153f4

Choose a tag to compare

Added

Fixed

  • Fix param names and Ruby syntax in API doc examples. (@mensfeld in #196)

Compare v1.9.0 ... v1.10.0

v1.9.0

24 Jun 21:02
v1.9.0

Choose a tag to compare

Added

Fixed

Compare v1.8.3...v1.9.0

v1.8.3

04 Apr 09:23
v1.8.3

Choose a tag to compare

Fixed

Compare v1.8.2...v1.8.3

v1.8.2

15 Mar 15:06
v1.8.2

Choose a tag to compare

Fixed

Compare v1.8.1...v1.8.2

v1.8.1

12 Mar 19:25
v1.8.1
8ae07a2

Choose a tag to compare

Fixed

Compare v1.8.0...v1.8.1

v1.8.0

12 Mar 12:05
v1.8.0

Choose a tag to compare

Added

  • New extension for RSpec (@flash-gordon in #183):
    One of the pain points of testing monads is referencing class constants from specs.
    This extension catches missing class constants, analyzes the call site and
    returns a matching constant.

    Before, this code would raise a NameError because Failure is a constant
    that is missing in Object:

    example "missing constant" do
      expect(call_operation).to eql(Failure[:some_error, "some message"])
    end

    Now, after enabling the extension, it will return the correct constant:

    Dry::Monads.load_extensions(:rspec)
    
    example "missing constant" do
      Failure[:some_error, "some message"] # => Failure[:some_error, "some message"]
    end

    Out of the box, the extension will check if Success, Failure, Some, and
    None are referenced from a file ending with _spec.rb.

    More involved analysis is possible if you add debug_inspector to your Gemfile:

    group :test do
      gem "debug_inspector"
    end

    This will allow referencing constants from other modules, such as rspec helpers.

    The extension also adds new matchers for Success, Failure, Some, and
    None values.

    expect(Success(1)).to be_success
    expect(Success(1)).to be_success(1)
    expect(Success(1)).to be_success { |x| x > 0 }
    expect(Success(1)).to be_a_success { |x| x > 0 }
    
    expect(Failure(1)).to be_failure(1)
    
    expect(Some(1)).to be_some
    expect(Some(1)).to be_success
    
    expect(None()).to be_none
    expect(None()).to be_failure
  • New extension for super_diff (@flash-gordon in #184):

    Adds support for improved diff output in specs when using the super_diff gem.
    This makes it easier to understand the differences between monad values in test failures.

    To use this extension:

    1. Add super_diff to your Gemfile's test group:
      group :test do
        gem "super_diff"
      end
    2. Load the extension:
      require "dry/monads"
      Dry::Monads.load_extensions(:super_diff)

    This will change the diff output for monad values to be more readable.

    Before:

    -Success({a: 2, c: 2})
    +Success({a: 1, b: 2})
    

    After:

    Success(
    -   a: 2,
    +   a: 1,
    -   c: 2
    +   b: 2
    )
    

Compare v1.7.1...v1.8.0

v1.7.1

21 Jan 11:37
v1.7.1

Choose a tag to compare

Fixed

Compare v1.7.0...v1.7.1

v1.7.0

07 Jan 16:16
v1.7.0

Choose a tag to compare

Fixed

Changed

Compare v1.6.0...v1.7.0

v1.6.0

04 Nov 17:55
v1.6.0
8c42280

Choose a tag to compare

Changed

Compare v1.5.0...v1.6.0

v1.5.0

16 Oct 17:54
v1.5.0

Choose a tag to compare

Changed

Compare v1.4.0...v1.5.0