ChewyB has quit [Read error: Connection reset by peer]
ChewyB has joined #ruby
jla has quit [Ping timeout: 276 seconds]
<nakilon>
isene, yo dawg, I heard you love pithon? so we added the method #in to String class so you could write in pithon while writing in ruby; here take ActiveSupport with 3498539847 other core extensions, good luck
jinie has joined #ruby
somazero has quit [Remote host closed the connection]
<alexherbo2>
is there an opposite to rspec shared example?
<alexherbo2>
I have a test for `.find` with a context `when not found` where I have a shared example `a Pokemon`, I would like something like: `it_behave_not_like 'a Pokemon'`
cliluw has quit [Ping timeout: 240 seconds]
cliluw has joined #ruby
coniptor has quit [Ping timeout: 246 seconds]
coniptor has joined #ruby
cliluw has quit [Ping timeout: 258 seconds]
linoge has quit [Read error: No route to host]
linoge has joined #ruby
stryek has joined #ruby
cuerbot has joined #ruby
elcuervo has quit [Ping timeout: 276 seconds]
alexherbo2 has quit [Ping timeout: 265 seconds]
jla has joined #ruby
alexherbo2 has joined #ruby
User458764 has quit [Ping timeout: 260 seconds]
User4587_ has quit [Ping timeout: 264 seconds]
User458764 has joined #ruby
einyoul_ has quit [Ping timeout: 264 seconds]
al2o3-cr has quit [Ping timeout: 256 seconds]
al2o3-cr has joined #ruby
einyoul has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
GodFather has joined #ruby
ChewyB has quit [Read error: Connection reset by peer]
joast has joined #ruby
ChewyB has joined #ruby
ChewyB has quit [Read error: Connection reset by peer]
jla has quit [Quit: Leaving.]
jla has joined #ruby
ChewyB has joined #ruby
duderonomy has joined #ruby
sinan has joined #ruby
GodFather has quit [Ping timeout: 265 seconds]
akem_ has quit [Read error: Connection reset by peer]
<phaul>
alexherbo2: my bet is the answer is no. You can negate things at the matcher level, but shared examples are more like describing some complex behaviour. I'm not sure what the opposite of that means or why that woould be useful. Ie if you think about it, Array, String BasicObject all don't behave like a Pokemon
gdc_m has joined #ruby
<phaul>
maybe it's an xy problem where describing what the goal is would be better than proposing a solution
<phaul>
&fact xy
<rubydoc>
it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
einyoul has quit [Ping timeout: 264 seconds]
ChmEarl has joined #ruby
GodFather has joined #ruby
noctux has quit [Ping timeout: 240 seconds]
noctux has joined #ruby
jla has quit [Ping timeout: 240 seconds]
jla has joined #ruby
einyoul has joined #ruby
brainfunnel has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
FetidToot has joined #ruby
hiroaki has joined #ruby
<NL3limin4t0r>
alexherbo2: You can write your own matchers though. You could write the matcher `behaves_like_a` and you are able to do something like `expect(subject).to behave_like_a(:pokemon)` and `expect(subject).to_not behave_like_a(:pokemon)`
<apotheon>
Yeah, `#to_not behave_like` is much better than something like `#does_not_behave_like` or `#to not_behave_like`.
<apotheon>
to_not should work just fine, last I checked
<apotheon>
It's also more grammatically precise than not_to.
<NL3limin4t0r>
Yeah, that's why I choose it in the first place, but I was second guessing myself because the documentation uses `not_to` and I was not sure if it is aliased. But I guess it is.
<apotheon>
I had a boss once who wondered why I kept using to_not instead of not_to.
<apotheon>
I explained it, and he still didn't seem to understand.
<apotheon>
"because English"
<apotheon>
That's the short version, but not the version I gave the boss.
sinan has quit [Quit: sinan]
<NL3limin4t0r>
The more gramatically correct one is often the better choice, but the alias is nice because depending on the context #to_not might not always be the best option.
<leftylink>
hmm, will need to think about it for a bit, non native speaker...
<leftylink>
I guess to not seems to make more sense to me. I expect you to not insult your coworkers vs I expect you not to insult your coworkers
<apotheon>
You can think of it as "not" binding to the preceding term.
ChewiB has joined #ruby
<apotheon>
Most native English speakers don't think about stuff enough to notice this.
kristian_on_linu has quit [Remote host closed the connection]
<apotheon>
That binding statement doesn't really clarify the grammatical rules, but I think it kinda works as shorthand thinking about it.
<apotheon>
hmm
<phaul>
one should not confuse the purpose of matchers with shared examples though. Yes you can negate matchers, but matchers and shared examples are on different level of abstraction... That's why I was saying maybe a disscussion on what we are trying to achieve here first could be useful
<apotheon>
Okay, a better explanation:
ChewyB has quit [Ping timeout: 256 seconds]
<apotheon>
The application of "not" is ambiguous, actually. It can apply either to the term before or after it, though applying to the term before it is more awkward. In the case of "expect not to", which of "expect" and "to" is affected makes the clause meaning ambiguous, but "to not match" is unambiguous because the negation of either "to" or "match" has the same overall semantic effect.
FastJack has quit [Ping timeout: 265 seconds]
<apotheon>
. . . and there are, of course, instances of Skitt's Law in my explanation.
<apotheon>
(e.g. placement of "either" in that sentence is grammatically less than ideal)
FetidToot has quit [Quit: FetidToot]
fercell has quit [Ping timeout: 240 seconds]
fercell has joined #ruby
FastJack has joined #ruby
schne1der has quit [Ping timeout: 256 seconds]
vondruch__ has quit [Read error: Connection reset by peer]
dhollinger has quit [Ping timeout: 272 seconds]
vondruch__ has joined #ruby
al2o3-cr has quit [Ping timeout: 256 seconds]
sgen_ has joined #ruby
orbyt_ has joined #ruby
jenrzzz has joined #ruby
jla has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
mic_e_ has joined #ruby
TomyWork has quit [Remote host closed the connection]
mic_e_ has quit [Ping timeout: 258 seconds]
dhollinger has joined #ruby
gix has joined #ruby
kristian_on_linu has joined #ruby
kristian_on_linu has quit [Remote host closed the connection]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cnsvc has joined #ruby
ritsch_master has joined #ruby
NL3limin4t0r is now known as NL3limin4t0r_afk
cb- has quit [Ping timeout: 240 seconds]
jla has quit [Ping timeout: 258 seconds]
nofxx__ has joined #ruby
sgen__ has joined #ruby
gix- has joined #ruby
gix has quit [Disconnected by services]
sgen_ has quit [Ping timeout: 276 seconds]
nofxx_ has quit [Ping timeout: 276 seconds]
akem has joined #ruby
GodFather has quit [Ping timeout: 264 seconds]
dinfuehr has quit [Ping timeout: 256 seconds]
dinfuehr has joined #ruby
alexherbo2 has quit [Ping timeout: 240 seconds]
dnadev2 has joined #ruby
postmodern has quit [Quit: Leaving]
<dnadev2>
hi, looking for a decent way to grab a part of a string. str = "This part will be variable. AdvertisingID: Source 123456, More Stuff variable in length." In this example i need the "Source 123456" - it will always be after the "AdvertisingID:" and will always end with ",".
<ritsch_master>
dnadev2: well sounds like you need a regex
<ritsch_master>
actually you will need 2
<ritsch_master>
first one checking if the string matches your pattern
<ritsch_master>
the second one to retrieve "Source ..."
<phaul>
&>> "This part will be variable. AdvertisingID: Source 123456, More Stuff variable in length."[/(?<=AdvertisingID: ).*(?=,)/]