Perl 6 - the future is here, just unevenly distributed

IRC log for #pr-challenge, 2015-12-05

| Channels | #pr-challenge index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:11 neilb joined #pr-challenge
01:23 neilb_ joined #pr-challenge
02:54 rocamador joined #pr-challenge
04:27 Zoffix joined #pr-challenge
07:31 rocamador joined #pr-challenge
08:40 neilb joined #pr-challenge
09:21 neilb must remember: don’t send any emails until fully awake
09:21 rocamador joined #pr-challenge
09:28 neilb kentnl: your dist assigned was File-ShareDir-ProjectDistDir
09:44 bjakubski joined #pr-challenge
09:58 choroba joined #pr-challenge
10:22 rocamador joined #pr-challenge
10:52 Peter joined #pr-challenge
10:58 choroba Thanks for the tip, my mock Net::Stripe already passes the first 19 tests
10:58 choroba all I had to do so far was to copy 2 example JSONs from the API documentation
10:58 choroba #20 seems a bit tougher, though...
11:17 neilb joined #pr-challenge
12:04 rocamador joined #pr-challenge
13:39 rocamador joined #pr-challenge
14:11 gansh1 joined #pr-challenge
14:28 choroba fixed 1 .. 60, moving on
14:30 choroba I feel like reimplementing stripe.com, though :)
14:31 Zoffix :)
15:15 rocamador joined #pr-challenge
15:21 rocamador left #pr-challenge
15:52 choroba The problem is that Test::LWP::UserAgent is stateless, you have to define the response based on the request only
15:53 choroba but the service I'm trying to mock behaves differently
15:53 choroba so, what I do - when I get a DELETE request, for example, I change the useragent object to another one that changes the behaviour
15:53 choroba is it a sane approach?
15:55 choroba https://github.com/choroba/stripe-perl/blob/mock/t/mock.t
15:56 choroba line 187
15:56 choroba or 214
16:05 gansh1 joined #pr-challenge
18:20 choroba #75
19:21 ether choroba: neat!
19:21 ether you could also subclass Test::LWP::UserAgent and add a field to track state
19:22 ether or stick a Moo role on it perhaps
19:22 ether something as simple as this might work:
19:24 ether package MyTest::LWP::UserAgent; use base 'Test::LWP::UserAgent'; sub new { my $self = shift->SUPER::new(@_); $self->{state} = 'state 1'; return $self }   sub send_request { shift->SUPER::send_request(@_); $self->{state} = 'state 2'; } # etc
19:59 choroba I'll see. The first task is to get the tests pass :)
20:05 gansh joined #pr-challenge
21:49 choroba #94
23:35 choroba #110
23:37 jberger joined #pr-challenge

| Channels | #pr-challenge index | Today | | Search | Google Search | Plain-Text | summary