键入“后卫”会有例外

时间:2013-09-03 15:50:28

标签: ruby rubygems gem phpunit guard

我正在尝试使用Jeffrey Way的书来学习Guard,但是当我guard时遇到问题。虽然我没有犯任何错误,但我遵循了指南。

C:\Users\Imaqtpie\Desktop\LaravelTestingDecoded\chapter3>guard
18:41:48 - INFO - Guard is using TerminalTitle to send notifications.
18:41:48 - INFO - Running all tests
PHP Fatal error:  Call to undefined method     PHPUnit_Framework_TestResult::allCompletlyImplemented() in C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\guard-phpunit-0.1.4\lib\guard\phpunit\formatters\PHPUnit-Progress\PHPUnit\Extensions\Progress\ResultPrinter.php on line 250
PHP Stack trace:
PHP   1. {main}() C:\Users\Imaqtpie\Desktop\LaravelTestingDecoded\chapter3\vendor\phpunit\phpunit\composer\bin\phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() C:\Users\Imaqtpie\Desktop\LaravelTestingDecoded\chapter3\vendor\phpunit\phpunit\composer\bin\phpunit:63
PHP   3. PHPUnit_TextUI_Command->run() C:\Users\Imaqtpie\Desktop\LaravelTestingDecoded\chapter3\vendor\phpunit\phpunit\PHPUnit\TextUI\Command.php:129
PHP   4. PHPUnit_TextUI_TestRunner->doRun() C:\Users\Imaqtpie\Desktop\LaravelTestingDecoded\chapter3\vendor\phpunit\phpunit\PHPUnit\TextUI\Command.php:176
PHP   5. PHPUnit_Extensions_Progress_ResultPrinter->printResult() C:\Users\Imaqtpie\Desktop\LaravelTestingDecoded\chapter3\vendor\phpunit\phpunit\PHPUnit\TextUI\TestRunner.php:355
PHP   6. PHPUnit_Extensions_Progress_ResultPrinter->printFooter() C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\guard-phpunit-0.1.4\lib\guard\phpunit\formatters\PHPUnit-Progress\PHPUnit\Extensions\Progress\ResultPrinter.php:72
18:41:48 - INFO - .
> [#E489C62F50B0]
> [#E489C62F50B0] Finished in 52 ms
> [#E489C62F50B0]
> [#E489C62F50B0] Fatal error: Call to undefined method     PHPUnit_Framework_TestResult::allCompletlyImplemented() in C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\guard-phpunit-0.1.4\lib\guard\phpunit\formatters\PHPUnit-Progress\PHPUnit\Extensions\Progress\ResultPrinter.php on line 250
> [#E489C62F50B0]
> [#E489C62F50B0] Call Stack:
> [#E489C62F50B0]     0.0007     235072   1. {main}() C:\Users\Imaqtpie\Desktop\LaravelTestingDecoded\chapter3\vendor\phpunit\phpunit\composer\bin\phpunit:0
> [#E489C62F50B0]     0.0044     556064   2. PHPUnit_TextUI_Command::main() C:\Users\Imaqtpie\Desktop\LaravelTestingDecoded\chapter3\vendor\phpunit\phpunit\composer\bin\phpunit:63
> [#E489C62F50B0]     0.0044     561304   3. PHPUnit_TextUI_Command->run() C:\Users\Imaqtpie\Desktop\LaravelTestingDecoded\chapter3\vendor\phpunit\phpunit\PHPUnit\TextUI\Command.php:129
> [#E489C62F50B0]     0.0359    2805856   4. PHPUnit_TextUI_TestRunner->doRun() C:\Users\Imaqtpie\Desktop\LaravelTestingDecoded\chapter3\vendor\phpunit\phpunit\PHPUnit\TextUI\Command.php:176
> [#E489C62F50B0]     0.0521    3267312   5. PHPUnit_Extensions_Progress_ResultPrinter->printResult() C:\Users\Imaqtpie\Desktop\LaravelTestingDecoded\chapter3\vendor\phpunit\phpunit\PHPUnit\TextUI\TestRunner.php:355
> [#E489C62F50B0]     0.0521    3267632   6. PHPUnit_Extensions_Progress_ResultPrinter->printFooter() C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\guard-phpunit-0.1.4\lib\guard\phpunit\formatters\PHPUnit-Progress\PHPUnit\Extensions\Progress\ResultPrinter.php:72

18:41:48 - INFO - Guard is now watching at 'C:/Users/Imaqtpie/Desktop/LaravelTestingDecoded/chapter3'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- wdm (LoadError)
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/listen-1.3.0/lib/listen/adapter.rb:207:in `load_dependent_adapter'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/listen-1.3.0/lib/listen/adapters/windows.rb:33:in `load_dependent_adapter'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/listen-1.3.0/lib/listen/adapter.rb:198:in `usable?'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/listen-1.3.0/lib/listen/adapters/windows.rb:25:in `usable?'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/listen-1.3.0/lib/listen/adapter.rb:190:in `usable_and_works?'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/listen-1.3.0/lib/listen/adapter.rb:57:in `block in select_and_initialize'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/listen-1.3.0/lib/listen/adapter.rb:55:in `each'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/listen-1.3.0/lib/listen/adapter.rb:55:in `select_and_initialize'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/listen-1.3.0/lib/listen/listener.rb:290:in `initialize_adapter'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/listen-1.3.0/lib/listen/listener.rb:282:in `setup'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/listen-1.3.0/lib/listen/listener.rb:52:in `start'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/guard-1.8.2/lib/guard.rb:213:in `block in start'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/guard-1.8.2/lib/guard.rb:387:in `block in within_preserved_state'
    from <internal:prelude>:10:in `synchronize'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/guard-1.8.2/lib/guard.rb:384:in `within_preserved_state'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/guard-1.8.2/lib/guard.rb:209:in `start'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/guard-1.8.2/lib/guard/cli.rb:110:in `start'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor.rb:363:in `dispatch'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/guard-1.8.2/bin/guard:6:in `<top (required)>'
    from C:/RailsInstaller/Ruby1.9.3/bin/guard:23:in `load'
    from C:/RailsInstaller/Ruby1.9.3/bin/guard:23:in `<main>'

我已尝试修改PATH以指出正确的PHPUnit,它仍然是相同的。

怎么了?

另外,我应该学习Guard还是移动Grunt?我是PHP开发者。

1 个答案:

答案 0 :(得分:3)

我找到了解决方案。

问题是Ruby1.9.3\lib\ruby\gems\1.9.1\gems\guard-phpunit-0.1.4\lib\guard\phpunit\formatters\PHPUnit-Progress\PHPUnit\Extensions\Progress\ResultPrinter.php中的输入错误会影响3.7.*个版本。

您必须找到allCompletlyImplemented()方法并在第250和256行将其重命名为allCompletelyImplemented()