I'm in the process of making a Rails application be able to run on different machines other than the VM which is shared around (CentOS 5.5).
我正在使一个Rails应用程序能够在不同的机器上运行,而不是在共享的VM上运行(CentOS 5.5)。
I've got the tests to pass on my OSX running 10.7.3, except for a few, which do output ok results, but with a different order, such as:
我在运行10.7.3的OSX上通过了测试,除了少数几个,它们输出了ok结果,但是顺序不同,比如:
'some test' FAILED
expected: [831557419, 372199733, 89450236],
got: [372199733, 831557419, 89450236] (using ==)
I'm kinda lost here on how to debug and solve this. Any tips or leads that I could take a look?
我有点迷失在如何调试和解决这个问题上。有什么建议或线索可以让我看一下吗?
I'm using unixodbc, freetds and activerecord-sqlserver-adapter. It is a Rails 2.3.8 application, and RSpec 1.3.
我正在使用unixodbc、freetds和activerecord-sqlserver-adapter。它是一个Rails 2.3.8的应用程序和RSpec 1.3。
PS: Editing to point out that there are fixtures in the project. Someone suggested this could be the problem (fixtures are being created on a different order here), but I'm lost on how to solve it.
PS:编辑指出项目中有固定装置。有人认为这可能是问题所在(这里的fixture按照不同的顺序创建),但我不知道如何解决这个问题。
PPS: This is a current application being run on several VMs cloned from an original VM.
这是一个当前应用程序,运行在从原始VM克隆的多个VM上。
The tests have most of these expected values hardcoded, but the tests do pass on those VMs. I would rather not change the actual tests if possible.
测试中有大多数预期值是硬编码的,但是测试确实通过了这些vm。如果可能的话,我宁愿不更改实际的测试。
I am new to the codebase, on a consulting job. I'm trying to make this work on my machine to prove we can use any machine to develop (instead of a provided VM no one likes to code). The order is important.
我对代码库很陌生,从事咨询工作。我正在尝试在我的机器上使这个工作,以证明我们可以使用任何机器来开发(而不是提供没有人喜欢编码的VM)。顺序是很重要的。
2 个解决方案
#1
3
If the output is acceptable in any order, use this form:
如果输出是可接受的,请使用以下表格:
output.should =~ [831557419, 372199733, 89450236]
#2
2
Solved this by changing the Ruby version. Apparently 1.8.7 @ patchlevel > 250 changes something that causes this behavior.
通过更改Ruby版本解决了这个问题。显然是1.8.7 @ patchlevel >250改变了一些导致这种行为的东西。
#1
3
If the output is acceptable in any order, use this form:
如果输出是可接受的,请使用以下表格:
output.should =~ [831557419, 372199733, 89450236]
#2
2
Solved this by changing the Ruby version. Apparently 1.8.7 @ patchlevel > 250 changes something that causes this behavior.
通过更改Ruby版本解决了这个问题。显然是1.8.7 @ patchlevel >250改变了一些导致这种行为的东西。