jetchisel has quit [Quit: Unfortunately time is always against us -- [Morpheus]]
scottg has quit [Remote host closed the connection]
scottg489 has joined #ruby
Ritchie-X has quit [Quit: Leaving]
grenierm has joined #ruby
jetchisel has joined #ruby
jetchisel has quit [Client Quit]
jetchisel has joined #ruby
_whitelogger has joined #ruby
msv has quit [Remote host closed the connection]
grenierm has quit [Ping timeout: 272 seconds]
<rapha>
what do y'all find more important with rails ... unit tests or integration tests (e.g. selenium)?
schne1der has joined #ruby
dionysus69 has joined #ruby
Linux_Kerio has joined #ruby
msv has joined #ruby
inline__ is now known as inline
smp has quit [Read error: Connection reset by peer]
smp has joined #ruby
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
eoli3n has quit [Remote host closed the connection]
eoli3n has joined #ruby
Rounin has quit [Ping timeout: 244 seconds]
eoli3n has quit [Remote host closed the connection]
eoli3n has joined #ruby
Rounin has joined #ruby
Rounin has quit [Changing host]
Rounin has joined #ruby
andy-turner has joined #ruby
<gr33n7007h>
adam12: +1 patch btw! it's a shame tho as BSD is a solid platform but the wireless stack is neither here nor there :(
andy-turner has quit [Ping timeout: 252 seconds]
andy-turner has joined #ruby
andy-turner has quit [Read error: Connection reset by peer]
rvalue- has joined #ruby
rvalue has quit [Ping timeout: 276 seconds]
whysthatso125070 has joined #ruby
rvalue- is now known as rvalue
<adam12>
rapha: Lots of unit tests, many integration tests, few system tests.
jmcantrell has joined #ruby
user23 has joined #ruby
Sheilong has joined #ruby
<rapha>
and regarding the many unit tests, adam12, how do you make sure that (a) they cover all code paths, while (b) their plentifulness doesn't eat you all up?
<rapha>
hmm, and is selenium actually regarded as on the integration or the system level?
<adam12>
rapha: A lot of SimpleCov use, and they're generally fast enough that a few extra don't matter.
<adam12>
The whole integration/system test is kind of muddied in Rails.
<rapha>
ah, i didn't mean speed. i meant that writing them doesn't take forever.
<adam12>
Integration test is something that tests more than one controller. ie. a signup flow where the user creates their account then signs in.
<adam12>
Ah.
<adam12>
Well use one of the LLMS.
<rapha>
hmm...
<adam12>
But tests take time to write, there's no avoiding it.
<rapha>
that might actually be a sensible use of them.
<rapha>
the time is the one thing, but often i find i stumble over something where i just can't figure out how to test it. incredibly frustrating, especially if it then eats into the limited time you have.
<adam12>
Hard to test is usually a sign of poor design.
<adam12>
(no offence)
<rapha>
fair enough
<rapha>
and none taken, since i work with legacy code that i didn't write :P
<adam12>
Think about smaller methods. Extracting out side-effects, etc.
<adam12>
Yeah. That's a huge challenge and you may find unit tests less valuable there.
<adam12>
If you read the Working Effectively with Legacy Code book by Feathers, you'll see he starts with a "integration" (again, muddied term) test where it tests the whole system as a unit.
<adam12>
Because unit testing small components are likely hard if they weren't given any thought about testability in the first place.
<rapha>
right now i'm again in the situation where even the tests that do exist, won't run. i spent a day trying to get them to work but felt like sysyphos, so now i made a branch where i bumped the ruby version to 2.7 and the rails version to 6.0 hoping i won't have broken so much that it's not clear anymore how things are supposed to be.
<rapha>
and i do have that book. never read it though. thank you for the reminder, adam12!
<adam12>
IMHO, I wouldn't change anything without some tests. Even if that's a set of Playwright scripts you run against a sandbox of some sort.
<adam12>
Set up some tests for the happy paths for the most critcial paths and then at least you'd have _some_ confidence that it's not busted.
<rapha>
hmm, could determine the playwright scripts by clicking around manually together with the stakeholder and making notes
chair1 has joined #ruby
<nakilon>
18:09:14 <havenwood> I sometimes do RBS but don't ever do Yard
<nakilon>
it my case neither is really needed. it's just the coworker who says he needs these things for dropdowns in Rubymine, otherwise he would not understand the code
<nakilon>
havenwood: speaking of examples; for now I have a `module Document` with nested `module InstanceMethods` and `module ClassMethods`, and when I define some specific document class I do `include Document::InstanceMethods; extend Document::ClassMethods`
<nakilon>
that's how I have it impossible to instantiate a parent class -- it just does not exist; is it a proper way?
<nakilon>
it feels weird that to use the ingeriting class constant I have to prepend 'self::' while I don't have to do that for methods
<nakilon>
or rather even `self.class::`
polishdub has quit [Remote host closed the connection]
hansolo has quit [Ping timeout: 244 seconds]
polishdub has joined #ruby
Pixi__ is now known as Pixi
<havenwood>
nakilon: In a module, you can define instance methods directly then `def self.included(base) = base.extend(ClassMethods)` so you mixin only one thing. That said, you can also use `self.included(base) do` and avoid the ClassMethods module also.
<havenwood>
You might also want to module_function, so the included ones are privately included rather than exposing new public interface — but that depends on your code.