Skip to content

add static tests for coercion functions? #189

@sherrardb

Description

@sherrardb

similar to the test currently local.t

my $false =  bless( do{\(my $o = 0)}, 'JSON::PP::Boolean' );

  my $DATA = {
    'client_ip' => '138.197.111.110',
    'object' => 'token',
    'type' => 'card',
...
      'customer' => undef,
      'address_line1_check' => undef,
      'address_country' => undef
      }
  };

  Unexpected_keys_ignored: {
    my $obj =  Net::Stripe::_hash_to_object({
            %$DATA,
            'dummy_object' => {
              object  => 'foo_bar',
              garbage => 'bin',
            },
            dummy_scalar => 'rubbish',
    });
    is (ref($obj), 'Net::Stripe::Token', 'unmodelled data has no effect');
    ok (! exists($obj->{dummy_object}), 'dummy_object ignored');
    ok (! exists($obj->{dummy_scalar}), 'dummy_scalar ignored');
  }

we may want to add tests that confirm the expected behavior of _pre_2011_08_01_processing(),
_pre_2012_10_26_processing(), etc.

my testing has always involved forcing the API version with

    $req->header( 'Stripe-Version' => $ENV{STRIPE_API_VERSION} ) if exists( $ENV{STRIPE_API_VERSION} );

and iterating over a range of versions using a bash for loop, but obviously this method is of no benefit for users, cpantesters, etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions