Skip to content

Commit

Permalink
Make the errors from NoEventStorage bubble up through History.
Browse files Browse the repository at this point in the history
So the user sees their own call to TB2::History not inside TB2::History.

For #198
  • Loading branch information
schwern committed May 25, 2012
1 parent e47df19 commit adc2c55
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/TB2/History/NoEventStorage.pm
Expand Up @@ -4,6 +4,8 @@ use Carp;
use TB2::Mouse;
extends 'TB2::History::EventStorage';

our @CARP_NOT = qw(TB2::History);


=head1 NAME
Expand Down
3 changes: 3 additions & 0 deletions t/History/History.t
Expand Up @@ -72,7 +72,10 @@ note "Turn off event storage";
is $history->event_count, 3;

ok !eval { $history->events; 1 };
is $@, sprintf "Events are not stored at %s line %d.\n", __FILE__, __LINE__-1;

ok !eval { $history->results; 1 };
is $@, sprintf "Results are not stored at %s line %d.\n", __FILE__, __LINE__-1;

ok !eval { $history->store_events(1) }, "can't turn on storage for an existing object";
}
Expand Down

0 comments on commit adc2c55

Please sign in to comment.