Skip to content

Unable to use diff standalone #313

Description

@mrckzgl

Hi, I am trying to use the diff tool standalone as described here: https://splitwise.github.io/super_diff/releases/0.19.0/users/getting-started/#using-parts-of-superdiff-directly

If I plug two hashes in:

require 'super_diff'

puts(SuperDiff::EqualityMatchers::Main.call({}, {a:true}))

I get:

ArgumentError: wrong number of arguments (2 for 0..1) for SuperDiff::EqualityMatchers::Main initializer
/home/.rvm/gems/jruby-9.4.10.0/gems/attr_extras-7.1.0/lib/attr_extras/attr_initialize.rb:55:in `validate_arity'
org/jruby/RubyMethod.java:131:in `call'
/home/.rvm/gems/jruby-9.4.10.0/gems/attr_extras-7.1.0/lib/attr_extras/attr_initialize.rb:26:in `block in apply'
org/jruby/RubyClass.java:951:in `new'
/home/.rvm/gems/jruby-9.4.10.0/gems/attr_extras-7.1.0/lib/attr_extras/explicit.rb:67:in `block in static_facade'

If I plug two arrays in:

require 'super_diff'

puts(SuperDiff::EqualityMatchers::Main.call([], [1]))

I get:

NoMethodError: undefined method `merge' for []:Array
org/jruby/RubyArray.java:2009:in `each'
org/jruby/RubyEnumerable.java:1096:in `inject'
org/jruby/RubyEnumerable.java:1084:in `inject'
/home/.rvm/gems/jruby-9.4.10.0/gems/attr_extras-7.1.0/lib/attr_extras/attr_initialize.rb:24:in `block in apply'
org/jruby/RubyClass.java:951:in `new'
/home/.rvm/gems/jruby-9.4.10.0/gems/attr_extras-7.1.0/lib/attr_extras/explicit.rb:67:in `block in static_facade'

What am I missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions