semifor / Net-Twitter

A Perl interface to the Twitter APIs
83 stars 37 forks source link

s/JSON/JSON::MaybeXS/ #62

Closed oalders closed 8 years ago

oalders commented 8 years ago

Fixes #59

I was actually having trouble testing this:

Olafs-MacBook-Pro:Net-Twitter olaf$ dzil test
[DZ] building distribution under .build/5Loo6PgKtC for installation
[Run::BeforeBuild] executing: NET_TWITTER_NO_TRENDS_WARNING=1 /usr/bin/perl -I/lib src/build.pl 4.01010 'src/net-twitter-pod.tt2' 'lib/Net/Twitter.pod'
[Run::BeforeBuild] executing: pod2text 'lib/Net/Twitter.pod' 'README'
[DZ] beginning to build Net-Twitter
[PodVersion] lib/Net/Twitter.pod already has a VERSION section in POD
[ExtraTests] rewriting author test xt/author/pod-syntax.t
[ExtraTests] rewriting author test xt/author/pod-coverage.t
[DZ] guessing dist's main_module is lib/Net/Twitter.pm
Can't call method "content" on an undefined value at /Users/olaf/perl5/lib/perl5/Dist/Zilla/Plugin/ModuleBuild.pm line 221.

It looks like it's looking for a Build.PL at this point, which doesn't exist on my end. I get this error on my branch as well as on master. I'm up to date with the various dzil deps.

So, this allows me to run the tests:

diff --git a/dist.ini b/dist.ini
index 34f6ff1..83063ee 100644
--- a/dist.ini
+++ b/dist.ini
@@ -38,7 +38,7 @@ directory = examples

 [PruneFiles]
 filename = dist.ini
-filename = Build.PL
+;filename = Build.PL
 filename = README.md
 match = ^nytprof.*
 match = ^perl5

There are 3 failing tests for me, but they're also failing on the master branch:

t/10_net-twitter-regression.t (Wstat: 512 Tests: 5 Failed: 1)
  Failed test:  5
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/12_identica.t              (Wstat: 512 Tests: 1 Failed: 0)
  Non-zero exit status: 2
  Parse errors: Bad plan.  You planned 5 tests but ran 1.
t/15_subclass.t              (Wstat: 0 Tests: 27 Failed: 0)
  TODO passed:   13-16, 18
Files=36, Tests=2950, 29 wallclock secs ( 0.45 usr  0.12 sys + 25.08 cusr  2.07 csys = 27.72 CPU)
Result: FAIL
Failed 2/36 test programs. 1/2950 subtests failed.
oalders commented 8 years ago

Looks like two of these failures were already reported in #60

skaufman-socialflow commented 8 years ago

@oalders what's the reasoning behind switching from to_json to encode_json, I'm asking because encode_json is basically to_json + encode_utf8, was wondering if that was intentional.

oalders commented 8 years ago

@skaufman-socialflow actually, I wasn't aware that there was actually a difference between to_json and encode_json. I was using encode_json out of habit. I'll revert that change as well.

semifor commented 8 years ago

If you haven't already started an update to this PR @oalders, no worries. I'll amend the commit. I'm going to get this in and see if I can get a release out today. Thanks for the contribution!

oalders commented 8 years ago

@semifor I hadn't gotten to it yet. Thanks for taking care of this. :+1: