anchor.diff:        fun(_) ->
                 {"Start it up, check that we can get state",
                  fun() ->
  -                       V = ?NS:current_state(?NODE),
  -                       ?assertEqual(down, V)
  +                       V = ?NS:status(?NODE),
  +                       ?assertMatch({online,{unavailable, none}}, V)
                  end}
         end,
         fun(_) ->
                 {"Start it up, send hb",
                  fun() ->
                          ?NS:heartbeat(?NODE),
  -                       V = ?NS:current_state(?NODE),
  -                       ?assertEqual(down, V)
  +                       V = ?NS:status(?NODE),
  +                       ?assertMatch({online,{unavailable, none}}, V)
                  end}
         end,
         fun(_) ->
                 {"Start it up, send hb, sleep, check state",
                  fun() ->
                          ?NS:heartbeat(?NODE),
  -                       V1= ?NS:current_state(?NODE),
  -                       ?assertEqual(down, V1),
  -                       timer:sleep(?HB_INTERVAL),
  -                       V2 = ?NS:current_state(?NODE),
  -                       ?assertMatch(down, V2)
  +                       V1= ?NS:status(?NODE),
  +                       ?assertEqual({online, {unavailable, none}}, V1),
  +                       timer:sleep(?HB_INTERVAL),
  +                       V2 = ?NS:status(?NODE),
  +                       ?assertMatch({online, {unavailable, none}}, V2)
                  end}
         end,
         fun(_) ->
                 {"Start it up, send hb, sleep, check state until we drive it into 'up'",
                  fun() ->
                          ?NS:heartbeat(?NODE),
  -                       V1 = ?NS:current_state(?NODE),
  -                       ?assertEqual(down, V1),
  -                       timer:sleep(?HB_INTERVAL),
  -
  +                       ?ASSERT_DOWN(?NODE),
  +                       timer:sleep(?HB_INTERVAL),
  +
  +                       %% Drive it up
                          heartbeat_step(?NODE, ?HB_INTERVAL,6),
  -                       V2 = ?NS:current_state(?NODE),
  -                       ?assertMatch(up, V2)
  +                       ?NS:aborted(?NODE),
  +                       ?ASSERT_UP(?NODE)
                  end}
         end,
         fun(_) ->
                 {"Start it up, send hb, sleep, check state until we drive it into 'up', then wait until it goes down",
                  fun() ->
                          ?NS:heartbeat(?NODE),
  -                       V1 = ?NS:current_state(?NODE),
  -                       ?assertEqual(down, V1),
  -                       timer:sleep(?HB_INTERVAL),
  -
  +                       ?ASSERT_DOWN(?NODE),
  +                       timer:sleep(?HB_INTERVAL),
  +
  +                       %% Drive it up
                          heartbeat_step(?NODE, ?HB_INTERVAL, 6),
  -                       V2 = ?NS:current_state(?NODE),
  -                       ?assertMatch(up, V2),
  -
  +                       ?NS:aborted(?NODE),
  +                       ?ASSERT_UP(?NODE),
  +
  +                       %% Drive it down, scan, then wait a moment and check
                          timer:sleep(?HB_INTERVAL*7),
  -                       V3 = ?NS:current_state(?NODE),
  -                       ?assertMatch(down, V3)
  +                       pushy_node_stats:scan(),
  +                       timer:sleep(?HB_INTERVAL),
  +                       ?ASSERT_DOWN(?NODE)
                  end}
         end
        ]}.
  
positive.code: watcher_test_() ->
      {foreach,
       fun() ->
               test_util:start_apps(),
               meck:new(pushy_command_switch, []),
               meck:expect(pushy_command_switch, send_command,
                           fun(_NodeRef,  _Message) -> ok end),
               application:set_env(pushy, heartbeat_interval, ?HB_INTERVAL),
               {ok, Pid} = ?NS:start_link(?NODE),
               {Pid}
       end,
       fun({Pid}) ->
               meck:unload(pushy_command_switch),
               erlang:unlink(Pid),
               erlang:exit(Pid, kill),
               ok
  
negative.code: 
  -define(HB_INTERVAL, 100).
  -define(DECAY_WINDOW, 4). %% 4 is friendly to base 2 float arith
  -define(DOWN_THRESHOLD, 0.25).
  
  -include_lib("eunit/include/eunit.hrl").
  
  -define(ASSERT_UP(Node), ?assertMatch({online, {available, _}}, ?NS:status(Node)) ).
  -define(ASSERT_DOWN(Node), ?assertMatch({online, {unavailable, _}}, ?NS:status(Node)) ).
  
  basic_setup() ->
      test_util:start_apps(),
      pushy_node_stats:init(),
      meck:new(pushy_command_switch, []),
      meck:expect(pushy_command_switch, send,
                  fun(_NodeRef,  _Message) -> ok end),
      meck:expect(pushy_command_switch, send_command,
                  fun(_NodeRef,  _Message) -> ok end),
      application:set_env(pushy, heartbeat_interval, ?HB_INTERVAL),
      application:set_env(pushy, decay_window, ?DECAY_WINDOW),
      application:set_env(pushy, down_threshold, ?DOWN_THRESHOLD),
      ok.
  
  
  basic_cleanup() ->
      ets:delete(pushy_node_stats),
      meck:unload(pushy_command_switch).
  
  
  
  init_test_() ->
      {foreach,
       fun basic_setup/0,
       fun(_) ->
               basic_cleanup(),
               ok
       end,
       [fun(_) ->
  