新手问题 每次运行 spec 的时候我都想

i5ting · May 03, 2014 · Last by billy replied at May 03, 2014 · 1582 hits

每次运行 spec 的时候我都想

bundle exec rspec spec/requests/token_logins_spec.rb

能直接输入

token_logins_spec

就可以执行了

有人这样做么?

自己动手写个脚本应该可以解决这个问题,或者如果用 zsh 的话,可以写个 zsh 的插件。

正好这两天研究了下zshzsh 有个类似 method_missing 的 hook: command_not_found_handler

bash 据我所知是没有太好的办法,可以在 PROMPT_COMMAND 脚本里遍历 ./spec 目录,然后为每个 spec 定义函数或 alias

好吧,bash 支持 command_not_found_handle ,注意不是 handler,是 handle

#1 楼 @chunlea #2 楼 @lululau

如果没有轮子,就考虑写一个玩玩,哈哈

#4 楼 @i5ting 伸手党,盼求~

6 Floor has deleted
You need to Sign in before reply, if you don't have an account, please Sign up first.