Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Vlad Faust
    @vladfaust
    Yeah. So please paste your program and error
    Gian D
    @fusillicode_twitter
    Let's hope that this lobby will grow
    let me paste it
    Vlad Faust
    @vladfaust
    Let's hope not :D
    Gian D
    @fusillicode_twitter
    lol
    btw there's no error
    just failing specs
    Vlad Faust
    @vladfaust
    Specs fail with errors
    Give me context, give me specs
    Gian D
    @fusillicode_twitter
    well yeah that's a kind of error sure, I was thinking about compilation errors 😅
    sure
    let me get them
    this is the output
    I've put a pp inside the blank rule to see the actual processed properties
    and it seems that I only get the property for which I have a validate call inside the struct under test
    Vlad Faust
    @vladfaust
    You could put pp into the validations code itself (the lib's) for debug purposes
    Gian D
    @fusillicode_twitter
    you're right
    Vlad Faust
    @vladfaust
    The issue is too broad for me now, please try to narrow it
    Gian D
    @fusillicode_twitter
    sure sure I totally understand ;)
    Vlad Faust
    @vladfaust
    Thank you
    Gian D
    @fusillicode_twitter
    ok I've found a solution
    but only by playing around blindly so beware I've still some missing knowledge to fill

    anyway with

    def validate
        previous_def
    end

    inside the shared validations module and

    def validate
        super
    end

    inside the structs that mixes the module it seems that everything works fine

    Vlad Faust
    @vladfaust

    Hm.

    def validate
        super
    end

    Doesn't make sense. If it compiles, it means validate is already defined

    And if removing

    def validate
        super
    end

    , specs fail?

    Gian D
    @fusillicode_twitter
    yes :(
    Vlad Faust
    @vladfaust
    That's a damn magic
    BTW, you want these gigantic specs to be included into the lib?
    Gian D
    @fusillicode_twitter
    well maybe it would help to have some reference regarding this case but I think that I need to clean them up
    they're somehow specific to a problem :)
    let me delete them and try to prepare a simpler example :)
    can I d?
    Vlad Faust
    @vladfaust
    If you adding a rule, add specs for it
    Gian D
    @fusillicode_twitter
    sure sure
    Vlad Faust
    @vladfaust
    And just for it
    If you catch a bigger bug, it's another issue and should be considered separately
    Gian D
    @fusillicode_twitter
    totally agree
    for now let me clean up this lobby from the gigantic code samples XD
    Vlad Faust
    @vladfaust
    And remember, when you're doing a PR, you create obligations for the maintainer to maintain your code onwards. So make sure the code is simple as possible
    Gian D
    @fusillicode_twitter
    👍🙇‍♂️
    Joakim Repomaa
    @repomaa
    hey @vladfaust
    i thought it's maybe easier if i write you here instead of going back and forth on the github issue
    Vlad Faust
    @vladfaust
    Yeah, hi, Joakim
    Joakim Repomaa
    @repomaa
    i'm not quite sure what you mean with the equals operator
    Vlad Faust
    @vladfaust
    Well, in your specs you're testing very basic language functionality -- whether did the DB variable changed
    I propose to write actual transaction call instead, it could be a simple SELECT 1 wrapped in a tx
    Just to make sure it works as intended
    Joakim Repomaa
    @repomaa
    ah ok
    it wouldn't compile if it didn't but ok :D