# -*- coding: utf-8 -*-
'''
    tests.test_doubleclick
    ~~~~~~~~~~~~~~~~~~~~~~

    :copyright: (c) 2014 Markus Unterwaditzer & contributors
    :license: MIT, see LICENSE for more details.
'''
from click.testing import CliRunner

from vdirsyncer.doubleclick import _ctx_stack, click, ctx as global_ctx


def test_simple():
    @click.command()
    @click.pass_context
    def cli(ctx):
        assert global_ctx
        assert _ctx_stack.top is ctx

    assert not global_ctx
    runner = CliRunner()
    runner.invoke(cli)

@@ -428,29 +428,98 @@
 ert 
-_ctx_stack.top is ctx
+ctx.obj is global_ctx.obj%0A        assert _ctx_stack.top is ctx%0A        click.echo('hello')
 %0A%0A  
@@ -566,24 +566,33 @@
 Runner()%0A   
+ result =
  runner.invo
@@ -597,10 +597,130 @@
 voke(cli
-)
+, catch_exceptions=False)%0A    assert not global_ctx%0A    assert not result.exception%0A    assert result.output == 'hello%5Cn'
 %0A

Fix dead doubleclick testcase