<tbuehlmann>
ruby-beth, you might miss a / on the links: /admin/add_reservation instead of admin/add_reservation
rsl has joined #ruby-lang
sirfilip_ has quit [Quit: Leaving]
<ruby-beth>
thanks @tbuehlmann - not sure how this works - never used it before!
taylorrf has quit [Ping timeout: 252 seconds]
malconis has joined #ruby-lang
b_hoffman has joined #ruby-lang
mkaesz has quit [Read error: No route to host]
amystephen has joined #ruby-lang
mkaesz has joined #ruby-lang
bruno- has quit [Quit: Lost terminal]
ruby-beth has quit [Ping timeout: 246 seconds]
iffyuva has quit [Ping timeout: 252 seconds]
shinnya has joined #ruby-lang
gacekjk has quit [Quit: leaving]
x0f has joined #ruby-lang
b_hoffman has quit [Quit: b_hoffman]
taylorrf_ has quit [Remote host closed the connection]
taylorrf has joined #ruby-lang
tkuchiki_ has joined #ruby-lang
terpo has quit []
taylorrf has quit [Ping timeout: 244 seconds]
tkuchiki has quit [Ping timeout: 250 seconds]
banister has joined #ruby-lang
tmpo has joined #ruby-lang
nathanstitt has quit [Quit: I growing sleepy]
micmus has quit [Ping timeout: 264 seconds]
iamninja has joined #ruby-lang
ghostpl_ has joined #ruby-lang
iamninja has quit [Client Quit]
intinig has quit [Remote host closed the connection]
iamninja has joined #ruby-lang
lytol has joined #ruby-lang
intinig has joined #ruby-lang
iamninja has quit [Client Quit]
mkaesz has quit [Read error: No route to host]
mkaesz has joined #ruby-lang
iamninja has joined #ruby-lang
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ghostpl_ has quit [Ping timeout: 256 seconds]
lytol has quit [Ping timeout: 264 seconds]
taylorrf has joined #ruby-lang
SuMo_D has quit [Remote host closed the connection]
tkuchiki_ has quit [Remote host closed the connection]
iamninja has quit [Quit: WeeChat 1.1.1]
tkuchiki has joined #ruby-lang
donovan has joined #ruby-lang
taylorrf has quit [Ping timeout: 265 seconds]
iamninja has joined #ruby-lang
tkuchiki has quit [Ping timeout: 265 seconds]
allomov has quit [Remote host closed the connection]
nathanstitt has joined #ruby-lang
nathanstitt has quit [Client Quit]
iamninja has quit [Client Quit]
mathie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
cryo28 has quit [Quit: leaving]
tkuchiki has joined #ruby-lang
Xzanron_ has quit [Quit: Leaving]
roamingdog has quit [Remote host closed the connection]
iamninja has joined #ruby-lang
allomov has joined #ruby-lang
iamninja has quit [Client Quit]
iamninja has joined #ruby-lang
tmpo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
iamninja has quit [Client Quit]
iamninja has joined #ruby-lang
tunaCanBruh has joined #ruby-lang
iamninja has quit [Client Quit]
nathanstitt has joined #ruby-lang
fujimura has joined #ruby-lang
fujimura has quit [Remote host closed the connection]
fujimura has joined #ruby-lang
sarkyniin has joined #ruby-lang
mattyohe has joined #ruby-lang
sarkyniin has quit [Remote host closed the connection]
b_hoffman has joined #ruby-lang
ruby-beth has joined #ruby-lang
banister has joined #ruby-lang
charliesome has quit [Quit: zzz]
charliesome has joined #ruby-lang
maso has quit [Remote host closed the connection]
roamingdog has joined #ruby-lang
b_hoffman has quit [Quit: b_hoffman]
charliesome has quit [Client Quit]
iamninja has joined #ruby-lang
b_hoffman has joined #ruby-lang
iamninja has quit [Client Quit]
iamninja has joined #ruby-lang
btiefert2 has quit [Read error: Connection reset by peer]
mnilsson has quit [Ping timeout: 245 seconds]
shinnya has quit [Ping timeout: 246 seconds]
rindolf has quit [Quit: http://www.shlomifish.org/ ; It takes Summer Glau exactly a minute to write a rebuttal like in xkcd: “Venting”, and she would sign it as Chuck Norris. ( http://is.gd/U2VvJt )]
slawrence00 has joined #ruby-lang
concernedcitizen has joined #ruby-lang
mkaesz has quit [Read error: No route to host]
b_hoffman has quit [Quit: b_hoffman]
rippa has joined #ruby-lang
b_hoffman has joined #ruby-lang
mkaesz has joined #ruby-lang
micmus has joined #ruby-lang
iamninja has quit [Quit: WeeChat 1.1.1]
ghostpl_ has joined #ruby-lang
b_hoffman has quit [Client Quit]
lsegal` has joined #ruby-lang
iamninja has joined #ruby-lang
concernedcitizen has quit [Remote host closed the connection]
ghostpl_ has quit [Ping timeout: 264 seconds]
tunaCanBruh has quit [Ping timeout: 240 seconds]
iamninja has quit [Quit: WeeChat 1.1.1]
iamninja has joined #ruby-lang
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tkuchiki has quit [Remote host closed the connection]
iamninja has quit [Client Quit]
iamninja has joined #ruby-lang
iamninja has quit [Client Quit]
iamninja has joined #ruby-lang
iamninja has quit [Client Quit]
iamninja has joined #ruby-lang
iamninja has quit [Client Quit]
tunaCanBruh has joined #ruby-lang
allomov has quit [Remote host closed the connection]
DivineEntity has quit [Quit: Lost terminal]
iamninja has joined #ruby-lang
mkaesz has quit [Read error: No route to host]
iamninja has quit [Client Quit]
mkaesz has joined #ruby-lang
DivineEntity has joined #ruby-lang
<yorickpeterse>
Aha
<yorickpeterse>
derp wrong channel
mathie has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
hahuang62 has joined #ruby-lang
<darix>
yorickpeterse: at least it was just "aha" and nothing worse ;)
havenwood has joined #ruby-lang
jgpawletko has joined #ruby-lang
chouhoul_ has joined #ruby-lang
roamingdog has quit [Remote host closed the connection]
<yorickpeterse>
Hey I don't use hunter2 as my password
<Daneo>
The line ' @publication.title = 'Derpie'' fails to compile when running the tests, while the line above it works as expected. Probably something I don't know as I'm not that familiar with Ruby. But I'm curious to the cause of this.
solars has joined #ruby-lang
djbkd has quit [Remote host closed the connection]
<|jemc|>
Daneo: `before` blocks and `it` blocks are executed later by the test runner as tests/examples, with the example object as `self`
<|jemc|>
Daneo: `describe` blocks and `context` blocks are executed "immediately" when your file loads, with what you can think of as the example 'class' as `self`
mikecmpbll has joined #ruby-lang
<|jemc|>
so `@publication` in your `before` block is an instance variable of your example object, so it is not accessible in the example 'class' in the `context` block
<Daneo>
Because it has yet to be initialised
<|jemc|>
in short, an easy way to make your code work is to put your `@publication.title = ...` in a `before` block inside of your `context`
<|jemc|>
Daneo: there are two reasons you can't reach it from there
<|jemc|>
what you said is true, it is not yet initialized, but the biggest reason is its not executed on the same `self`
<|jemc|>
so it's not even getting stored/retrieved in the same object
lytol has quit [Remote host closed the connection]
lytol has joined #ruby-lang
lytol has quit [Remote host closed the connection]
<Daneo>
Hmm. Okey.
<|jemc|>
Daneo: also, take a look at `let` blocks in rspec
allomov has joined #ruby-lang
<|jemc|>
they are preferred by many over using instance variables in the example object
<pipework>
They also behave radically differently.
<|jemc|>
yes
<|jemc|>
which is why they are preferred by many
<Daneo>
The 'self' part is kind of confusing. But basically, as nearly everything is considered an object, the 'class' self creates the object's 'self', and after that are considered two different things ?
<|jemc|>
Daneo: they are always two different objects
<pipework>
Daneo: Actually, everything is an object except keywords.
<Daneo>
I'll do. Came across that somewhere.
<|jemc|>
an instance of Class is an object that can create an instance of itself with the `new` method
benanne has joined #ruby-lang
<|jemc|>
so they are two separate objects, they just have the relation that one created the other
<Daneo>
Alright, got that.
<|jemc|>
rspec 'hides' the kinds of objects you're dealing with and their relationship because it assumes you know the relation implicitly
arBmind1 has joined #ruby-lang
arBmind has quit [Ping timeout: 250 seconds]
<|jemc|>
that's why some prefer tests frameworks like minitest or test/unit because it's more obvious you are dealing with
<|jemc|>
however, rspec's features are very powerful and useful once you master them
<pipework>
Mmmm minitest
<pipework>
rspec is a pretty usually good kitchen sink for BDD and testing in general.
piotrj has quit [Ping timeout: 252 seconds]
piotrj has joined #ruby-lang
21WABDYLI has joined #ruby-lang
<Senjai>
People say minitest is the best
<Senjai>
and I tend to agree with them
<Senjai>
but I still use rspec
<Senjai>
even though sometimes it beats me, and abuses me
<Senjai>
simple prefer it <3
<bougyman>
I choose simpler.
<Senjai>
not every relationship is pefect
<bougyman>
bacon does everything I want without too much magic.
<Daneo>
And the behaviour of rspec, the initialisation sequence. how could I've known that? Is that specific to the framework? Or is it more common than that ?
<Senjai>
After you use rspec for a bajillion years, it's not magic anymore :P
<bougyman>
and it supports tap output, which is great for CI.
<|jemc|>
Daneo: it's specific to the framework - it's just something you learn and get used to
<Senjai>
Daneo: Im not sure what point |jemc| was trying to make
<Senjai>
|jemc|: Are you talking about stubbing?
matrisking has joined #ruby-lang
<|jemc|>
Senjai: no
<Senjai>
Oh
<Senjai>
Daneo: With rspec, the goal is to never set instance variables in before blocks..
<Senjai>
if you're doing that, you're not rspecing properly
<|jemc|>
Daneo: if you're looking for a general lesson here, just know that any time you pass a block to a method, the receiver could choose to execute that block at any time and from within any context it chooses
<Senjai>
Even though its valid, and is the right way of doing it in minitest
<pipework>
Yeah, I mean, if you need references to objects, lets are what you need.
<Senjai>
^
<|jemc|>
that is, blocks are not always executed immediately, or with the same self as the context you wrote them in
<Senjai>
Daneo: I enjoy rspec, but honestly, even thought I started with it, I would advise against starting with it
<pipework>
Senjai: Egh, the 'right' way in minitest tend to be either locals, lets, or methods from your ineherited testcase class.
lapide_viridi has joined #ruby-lang
<Senjai>
Because it is essentially its own little language
<pipework>
err, not lets, instance variables.
<|jemc|>
Daneo: so you have to read the documentation or the source code to find out how the block is being used
<Senjai>
pipework: Is there the equivilant of let(:symbol) { ... } in minitest?
<pipework>
Senjai: Not in minitest proper, but there is in extensions.
<pipework>
It's in MiniTest::Spec
<Daneo>
Senjai: The 'goal' ? :)
<Senjai>
Ah, yeah
<Senjai>
Without the "extension" assigning instance variables in before blocks
<Senjai>
err
<Senjai>
"setup"
<Senjai>
functions
<Senjai>
is the way to go
roamingdog has quit [Remote host closed the connection]
shinnya has joined #ruby-lang
<Daneo>
|jemc|: Okey. Thank you for the explanation
<Daneo>
|jemc|: It is a bit more clear now
<Daneo>
Senjai: And those setup methods are then called in their respective cases ?
<Senjai>
Daneo: With minitest, you can infer that it will do the things properly. That setup is called before every test, and teardown is called after every test
<Senjai>
But I would stick with VANILLA minitest, maybe extended with mocha for stubbing/mocking
<Senjai>
Until your rails/ruby foo is better, then try rspec if you want. It will be easier to understand the 'magic' then, but you might just end up sticking with minitest :P
<waxjar>
minitest runs its test in a random order doesn't it?
<pipework>
By default, yes.
<Senjai>
So does rspec, and every other decent frameowkr
<Senjai>
framework*
<Senjai>
tests should always run randomly
<pipework>
You have to call an embarrassingly named method to get it to run sequentially.
<pipework>
Though it has seeds, so you can reproduce.
<Senjai>
pipework: lol, what one is that
<Senjai>
No test should ever depend on another test. ergo, running them in any order should always work
<waxjar>
agree, i think it's neat that it does that
<Senjai>
pipework: Is it #run_my_tests_sequentially_because_im_obviously_doing_something_wrong ?
21WABDYLI has quit [Read error: Connection reset by peer]
djbkd has joined #ruby-lang
chacmool has quit [Remote host closed the connection]
javm has quit [Remote host closed the connection]
<|jemc|>
if you write your tests correctly, they won't depend on eachother anyway
ur5us has joined #ruby-lang
ur5us has quit [Remote host closed the connection]
<|jemc|>
having your tests run in order often makes it easy to pinpoint failures, especially with tests that hang or race conditions
ur5us has joined #ruby-lang
<|jemc|>
doing CI in a random order is okay, but while actively working on tests I always prefer to have them run in the order declared
<Senjai>
|jemc|: When debugging test order dependencies yes
<Senjai>
Nah, you only run them in a specified order (with a specified seed) when its obvious that there is a test order dependency
ghostpl_ has joined #ruby-lang
<|jemc|>
my tests are never order-dependent
<|jemc|>
my brain is
<pipework>
|jemc|: I just have tests be random everywhere.
<pipework>
If something's off, I use the seed from that run to find the problem.
<pipework>
ETERNAL VIGILANCE!
<|jemc|>
I've literally never had a problem caused by or covered up by the order of my tests
<pipework>
I have.
<waxjar>
haven't run into it yet either, but maybe thats *because* my tests run in order :P
<pipework>
There's not much benefit to having them run order dependent. Like, I can't see much value in warm fuzzies. The only time I run tests in the declared order is with the documentation formatter for rspec. And even then just to read the output once and then I got back to random order.
marr has joined #ruby-lang
isale-eko has joined #ruby-lang
<|jemc|>
pipework: the benefit is merely aesthetic and for my workflow efficiency, but with proper encapsulation of tests, randomized test order doesn't solve an actual need for me
ghostpl_ has quit [Ping timeout: 246 seconds]
mkaesz has quit [Read error: Connection reset by peer]
<|jemc|>
so the small benefits are worth it
<pipework>
It's hard to see that your order dependent tests are bad until you run them randomly. You might only see a problem every 1000 runs, but you won't see that unless you run them in random order. I can write tests that work in order 100% of the time and then fail legitimately when ran in random order.
<pipework>
I disagree, but I'd just override your settings on my machine if we worked together.
mkaesz has joined #ruby-lang
<|jemc|>
pipework: on my team we have an analogous disagreement about "failing fast" and that's what we do - just override settings on the local dev's machine
<pipework>
|jemc|: Yeah, I do that, but then call out authors that author bad things because their settings didn't suss out the issue in the commit that fixes it.
<|jemc|>
fair enough
<waxjar>
|jemc|: what benefits do you get by running them order-dependent?
<pipework>
waxjar: The order is always the same, so he can read the output in a consistent manner, is my guess.
yfeldblum has joined #ruby-lang
shazaum has quit [Quit: This computer has gone to sleep]
<|jemc|>
waxjar: I don't run them "order-dependent", I just run them in order
<waxjar>
heh, *in order
<|jemc|>
but as I said above, it's mostly aesthetic, with small workflow efficiency gains by being able to make a visual map of what's churning beneath those dots
<|jemc|>
I also use the Fivemat formatter, which groups tests by toplevel `describe` name
<waxjar>
ah, i see. fair enough
<pipework>
So your tests don't run fast enough that you have time to think? :D
<|jemc|>
heh
<|jemc|>
I'm glad we had this discussion though - currently working on a little test framework for my toy language and I didn't realize randomized test order was so widely used
<|jemc|>
I'll have to add a setting for it
<waxjar>
now that i think of it, i suppose if cutest ran its tests in a randomized order it would get annoying quickly. it's stops running tests after the first failing test
<waxjar>
that could be another test for every run :P
<|jemc|>
waxjar: yes, in-order and fail-fast is my preference
<|jemc|>
I only want to see one backtrace at a time
<|jemc|>
(except in CI)
roamingdog has joined #ruby-lang
skade has quit [Quit: Computer has gone to sleep.]
ldnunes has quit [Quit: Leaving]
whippythellama has quit [Quit: whippythellama]
<pipework>
I usually just use random order with seeds, sometimes fail-fast when working on one thing, but when running the whole suite, I don't use fail-fast.
jefus has quit [Ping timeout: 265 seconds]
banister has joined #ruby-lang
wprice has joined #ruby-lang
Musashi007 has joined #ruby-lang
jds has quit [Quit: Connection closed for inactivity]
Daneo has quit [Ping timeout: 246 seconds]
wallerdev has quit [Quit: wallerdev]
futilegames has quit [Quit: futilegames]
yfeldblum has quit [Remote host closed the connection]
<banister>
yorickpeterse love the slogan for KFC in holland "more spice than in some garden"
taylorrf has quit [Remote host closed the connection]
jefus has joined #ruby-lang
spuk has quit [Changing host]
spuk has joined #ruby-lang
solars has quit [Ping timeout: 246 seconds]
duderonomy has joined #ruby-lang
skade has joined #ruby-lang
skade has quit [Client Quit]
tunaCanBruh has quit [Ping timeout: 265 seconds]
fusillicode has joined #ruby-lang
tunaCanBruh has joined #ruby-lang
taylorrf has joined #ruby-lang
mnilsson has joined #ruby-lang
riotjones has joined #ruby-lang
zoo-zed has joined #ruby-lang
riotjones has quit [Ping timeout: 246 seconds]
yfeldblum has joined #ruby-lang
lytol has quit [Remote host closed the connection]
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
postmodern has joined #ruby-lang
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
bb010g has joined #ruby-lang
djbkd has quit [Remote host closed the connection]