Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected results with inheritance #123

Open
dnagir opened this issue May 3, 2019 · 0 comments
Open

Unexpected results with inheritance #123

dnagir opened this issue May 3, 2019 · 0 comments

Comments

@dnagir
Copy link

dnagir commented May 3, 2019

I was trying to abstract the common workflow using inheritance (generating new Class with Dry::Transaction included).

It was expected that it would behave just like a normal Dry::Transaction but it isn't.

TLDR: these tests are failing while I was expecting those to pass.

Full repro with tests - this gist.

Run the repro:

curl -s https://gist.githubusercontent.com/dnagir/71907e1b09e8be817d0644b5be1c29eb/raw/a6d9b8abacf873a2708bf82b9d714f82716d8ea5/example.rb | ruby
Run options: --seed 3951

# Running:

..FF

Finished in 0.002973s, 1345.4421 runs/s, 1345.4421 assertions/s.

  1) Failure:
InheritedAndHasUnexpectedBahviour#test_invalid [-:120]:
Expected: {:name=>["must be filled"]}
  Actual: {}

  2) Failure:
InheritedAndHasUnexpectedBahviour#test_valid [-:124]:
Expected: Success("yay")
  Actual: Success({:name=>"foo"})

4 runs, 4 assertions, 2 failures, 0 errors, 0 skips
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant