<FromGitter>
<crisward> `UInt8.slice(mynum.to_i16,my_num.to_i16/256)` ugly but it works
onethirtyfive has quit [Remote host closed the connection]
<BlaXpirit>
yeah, that's actually quite nice
onethirtyfive has joined #crystal-lang
onethirtyfive has quit [Ping timeout: 250 seconds]
<RX14>
i wish asterite had actually replied to my multipart PR message instead of going ahead and releasing 0.19 regardless
<BlaXpirit>
0.19 is released? T_T
<RX14>
it's tagged
<RX14>
but nothing else
soveran has quit [Remote host closed the connection]
<jhass>
there's actually a draft with the packages uploaded
<jhass>
no idea what Ary's waiting for
<FromGitter>
<sdogruyol> he's probably writing a blog post and announcement
<FromGitter>
<sdogruyol> :D
<FromGitter>
<sdogruyol> meanwhile Kemal just passed 1000 stars on Github
<RX14>
BlaXpirit, so I just had an idea
<RX14>
expectations are ugly, and we want to write assertions as regular crystal code
<RX14>
right?
<BlaXpirit>
sure
<RX14>
why not monkey-patch some common collections and matching methods when you require the "spec" library to allow the top-level expression to be debugged?
<RX14>
i'm not 100% sure how it would work
<RX14>
but then assert would become a simple macro
<RX14>
and the output would be customised
<RX14>
let me brainstorm on carc.in
<BlaXpirit>
RX14, well yeah, i was thinking about things like that
<BlaXpirit>
RX14, brainstorm in crystal play btw
<RX14>
effort to switch workspace to a termainl :P
<BlaXpirit>
ugh
<BlaXpirit>
what i was thinking was some special prefix for methods that deal with asssert info
<BlaXpirit>
or some wrapper
<BlaXpirit>
like... class Assert(Array); def ==(other : Array); return "items differ at index 5"
<BlaXpirit>
i dunno
<BlaXpirit>
this doesnt work of course but i'd like to see what you come up with
<BlaXpirit>
but yeah, my approach would be to make an addon that mirrors the structure, not a direct patch
<RX14>
well
<RX14>
hmm
<RX14>
oh
<RX14>
what if we just monkey patch enumerable and stuff
<RX14>
array.assert_includes? "foo"
<RX14>
eh
<BlaXpirit>
..........
<RX14>
better than array.should include("foo")
<BlaXpirit>
is it
<RX14>
yes
<BlaXpirit>
you made a mistake lol - it's. .should include
<BlaXpirit>
no i made a mistake in pointing out mistake
<BlaXpirit>
it's. .should contain
<BlaXpirit>
it's that bad
<RX14>
yeah i don't remmeber spec assertions
<RX14>
because i havent used them in so long
<BlaXpirit>
what's the future for us though? i hate writing unitests enough even without the DSLs
<RX14>
keep using power_assert macro
<RX14>
i guess
<BlaXpirit>
power_assert really is too slow though
<BlaXpirit>
and buggy
<BlaXpirit>
100 times slower is no joke
_whitelogger has joined #crystal-lang
<RX14>
something like that
<BlaXpirit>
could be worse
<BlaXpirit>
but if you add a macro that does all the previous_def stuff...
<BlaXpirit>
mmm this could be good
<BlaXpirit>
but hey, it takes away freedom to write shitty DSLs!!!
<RX14>
something like
<RX14>
add_assert_info Enumerable(T), includes?(obj) do |obj|
<RX14>
"Expected #{self} to be #{obj.foo}"
<RX14>
end
<BlaXpirit>
yeah, but i think it's slightly too much, could do with module Enumerable(T); add_assert_info
<RX14>
yeah i guess
<RX14>
BlaXpirit, see my comment on #3095
<RX14>
we need a github issue linker in here
<BlaXpirit>
why are notification emails delayed? :<
<RX14>
read github status
<BlaXpirit>
RX14, just join gitter >:)
<RX14>
but that's in a browser
<RX14>
i would need another chromium app window
<RX14>
when i can just join a channel in hexchat
<BlaXpirit>
i'm not being serious btw
<RX14>
could you add some functionaity to FromGitter?
<RX14>
that way it could ignore itself
<RX14>
and not pass the link messages to gitter
<BlaXpirit>
RX14, well it's a pure message resender bot
<RX14>
yeah...
<BlaXpirit>
but then again, it could be tied to the gitter room
<BlaXpirit>
link to issues of the repo that's tied to the gitter room
onethirtyfive has joined #crystal-lang
<jhass>
actually the github post receive hook can do issues if you enable it via the API iirc
<jhass>
the github IRC notifier that is
willl has quit [Quit: Connection closed for inactivity]
<BlaXpirit>
yeah it would be nice, but i think RX14 was trying to make a point that gitter users don't want those messages because they already see it linked in the original message
<RX14>
say that you know it's hacky but since it's only used in dev it should be ok
<BlaXpirit>
RX14, ok but what about generically overriding operations like '<'
<BlaXpirit>
oh wait, that's not needed, the fallback messages will be in the assert macro
<RX14>
?
<BlaXpirit>
forget it
<BlaXpirit>
I mean nevermind
soveran has joined #crystal-lang
onethirtyfive has quit [Remote host closed the connection]
<rkeene>
I thought there was some web framework for Crystal somewhere ? I can't find anything like that linked from the front page, or linked of a page from the front page
<tilpner>
rkeene - kemalcr.com ?
<tilpner>
Oh, maybe not a framework.
<tilpner>
"micro web framework"
<jhass>
there's about a dozen actually
<rkeene>
Yeah, I think kemal was it -- too bad it's not discoverable from the Crystal page
<BlaXpirit>
if all else fails, this assert can be put into a shard
<BlaXpirit>
at least we can avoid DSLs in our projects, not such a big deal, right?
onethirtyfive has joined #crystal-lang
<BlaXpirit>
RX14, what do you think about abusing $~ and stuff? its property may be just what we need
<BlaXpirit>
the property that it gets exposed into the outer call
<BlaXpirit>
oh no, it can interfere with normal methods setting it. forget it
<RX14>
uhh
<RX14>
nah
<RX14>
a class var on spec is nicer
<RX14>
to be honest
<BlaXpirit>
but not thread safe
<RX14>
make it a hash(Fiber, String?) then
<BlaXpirit>
lol
<RX14>
then index on current fiber in the setter
<RX14>
getter
<RX14>
it's the right way™
<BlaXpirit>
moving on to a slightly different topic, what is the current way to introduce the same setup/teardown steps to multiple tests?
<BlaXpirit>
so like this https://carc.in/#/r/18bf but it would actually be done before every test, not only before the first test
<BlaXpirit>
i hear minitest does it, but ugh
<RX14>
BlaXpirit, spec2
<RX14>
it's like the default specs but not feature-baren
<BlaXpirit>
but it still has a dsl
<RX14>
for assertions?
<RX14>
yeah ignore that and use power asserts
<BlaXpirit>
well rather than keeping this frankenstein monster, maybe we should make a lib with parts of spec2 and this hacky assert you just invented
<RX14>
it has almost the same spec dsl as the default one but with let and before/after
<RX14>
well argue with waterlink to seperate the assertions
<BlaXpirit>
RX14, why, if it's easier to make a different lib
<BlaXpirit>
because we need a lib to put the assert in anyway
<RX14>
yes
<RX14>
it's own library
<RX14>
with no spec DSL
<RX14>
assertions and spec DSLs have NOTHING to do with each other apart from 1 exception, I don't want people to keep making shards with them together
<RX14>
i want to be able to mix and mathc any assertion with any spec DSL
<BlaXpirit>
RX14, well... that can't be done currently. same old "move AssertionFailed to prelude" motif
<RX14>
yes, make a seperate PR for that once
<RX14>
which makes a solid case
<RX14>
then PR all the other spec libs to use it
<BlaXpirit>
pff, ysbadadden opposes even that
<RX14>
i'm pretty sure he doesn't
<RX14>
or wouldn't given a good reason
<RX14>
when he made the comment I think he thought that it was simply neccesary for the macro to work
<RX14>
i really can't belive that anyone would oppose this change
<BlaXpirit>
ruby brain damage
<BlaXpirit>
writing this kind of DSL is a special kind of pleasure, u know?
<RX14>
you need brackets around the includes?(obj)
<RX14>
BlaXpirit, you need |obj| on the block
<BlaXpirit>
well if done dirty then I don't
<RX14>
you do
<BlaXpirit>
this works on master
<RX14>
yes
<RX14>
the bug which meant you do was fixed
<RX14>
i remmeber it
<BlaXpirit>
RX14, another thing... considering that the checked expression is always topmost, doesn't it mean that its `Spec.assert_info =` code will be ran last? meaning that the indirection you pointed out isn't needed?
<RX14>
yes
<RX14>
it will be run last
<RX14>
but if the top level expression doesn't set it
<RX14>
it will blled through from the subexprs
<RX14>
bleed*
<RX14>
it's a corner case
<RX14>
but it's worth fixing
<BlaXpirit>
ok so change the other macro to Spec.assert_info = %res ? nil : {{yield}}
<RX14>
yeah thats more compacy i guess
<RX14>
compact*
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 244 seconds]
willl has joined #crystal-lang
bew78 has joined #crystal-lang
bew78 has quit [Client Quit]
bew78 has joined #crystal-lang
fedruantine has quit [Quit: client exited: Ex-Chat]
fedruantine has joined #crystal-lang
soveran has quit [Remote host closed the connection]
bew78 has quit [Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org]