def test_the_first_argument_can_be_a_url(self):
        "should be able to specify a url or file path"
        self._mock_exit(w=0)
        self.mocker.replay()

        from jasmine_runner.commands import main
        main(args=['jasmine-splinter', path_to_file('passed-specs.html')])

        self.mocker.verify()
    def test_specify_filepath(self):
        "should be able to specify the filepath"
        self._mock_exit(w=0)
        self.mocker.replay()

        from jasmine_runner.commands import main
        main(args=['jasmine-splinter', '--filepath=%s' % os.path.join(FIXTURES_ROOT, 'passed-specs.html')])

        self.mocker.verify()
    def test_specify_url(self):
        "should be able to specify the url of the runner"
        self._mock_exit(w=0)
        self.mocker.replay()

        from jasmine_runner.commands import main
        main(args=['jasmine-splinter', '--url=%s' % path_to_file('passed-specs.html')])

        self.mocker.verify()
    def test_main_with_default_options(self):
        "should look for a SpecRunner.html file in the current directory by default"
        getcwd = self.mocker.replace('os.getcwd')
        getcwd()
        self.mocker.result(FIXTURES_ROOT)
        self._mock_exit()
        self.mocker.replay()

        from jasmine_runner.commands import main
        main(args=['jasmine-splinter'])

        self.mocker.verify()
    def test_choose_the_splinter_driver(self):
        "should be able to choose the splinter driver from command line"
        from splinter.browser import Browser
        browser = Browser('firefox')

        self._mock_exit(w=0)
        Browser = self.mocker.replace('splinter.browser.Browser')
        Browser('chrome')
        self.mocker.result(browser)
        self.mocker.replay()

        from jasmine_runner.commands import main
        main(args=['jasmine-splinter', '--browser-driver=chrome', '--url=%s' % path_to_file('passed-specs.html')])

        self.mocker.verify()