小编Joe*_*lin的帖子

-bash:__ git_ps1:找不到命令

我试图安装Ruby 2.0.我的命令行是urped,现在看起来如下所示:

-bash: __git_ps1: command not found
[11:58:28][whatever@whatever ~]$ 
Run Code Online (Sandbox Code Playgroud)

我不知道如何摆脱__git_ps1命令找不到错误.我搜索了我的.bash_profile和我的.bashrc以查看它是否正在尝试设置变量或其他东西并且没有看到任何内容.我能找到git_ps1的唯一地方是〜/ .dotfiles/.bash_prompt.我完全替换该文件的内容,注销并重新登录,它什么也没有修复.

我看到了这个,但我对命令行很新,所以我只是把自己搞糊涂了.

有任何想法吗?

bash shell command git-bash ruby-2.0

52
推荐指数
5
解决办法
6万
查看次数

如何从rspec测试中调用方法

我正在学习Ruby和TDD(rspec).

我写了以下测试:

describe is_eligible do
  it "returns true if the passed in string is not part of a list" do
    result = is_eligible("abc")
    result.should eq(false)
  end
end
Run Code Online (Sandbox Code Playgroud)

它正在测试以下代码:

def is_eligible(team_name)
  array = Array.new
  array << "abc" << "def" << "ghi"
  if array.include?(team_name)
    return false
  else
    return true
  end
end
Run Code Online (Sandbox Code Playgroud)

我收到以下错误,无法找出原因.

*/Users/joel.dehlin/top32/lib/ineligible_teams.rb:6:in`is_eligible':错误的参数个数(0表示1)(ArgumentError)*

任何帮助表示赞赏!

ruby tdd rspec

2
推荐指数
1
解决办法
74
查看次数

标签 统计

bash ×1

command ×1

git-bash ×1

rspec ×1

ruby ×1

ruby-2.0 ×1

shell ×1

tdd ×1