惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - Franky
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
Vercel News
Vercel News
Recent Announcements
Recent Announcements
B
Blog RSS Feed
Y
Y Combinator Blog
M
MIT News - Artificial intelligence
MongoDB | Blog
MongoDB | Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
雷峰网
雷峰网
D
Docker
Jina AI
Jina AI
IT之家
IT之家
人人都是产品经理
人人都是产品经理
L
LangChain Blog
G
Google Developers Blog
Google DeepMind News
Google DeepMind News
MyScale Blog
MyScale Blog
博客园 - 叶小钗
The GitHub Blog
The GitHub Blog
The Cloudflare Blog
A
About on SuperTechFans
Hugging Face - Blog
Hugging Face - Blog

博客园 - Tachikoma

用Ruby实现 Web Service Server ,并用Ruby发送 HTTP请求 Web Service Android 使用 Ksoap2 出现的低级错误... - Tachikoma Cygwin中通过RJB在Ruby下调用ICTCLAS(JAVA) ICTCLAS4J 的编译脚本 Ruby Sandbox 实现运行客户代码 - Tachikoma Ruby在使用MongoDB时,对Cursor的重新包装 ruby 下使用 ICTCLAS(JAVA) RJB 在windows下的一些安装事项 在dell dimension 5150 上安装 leopard 手记 Rails测试中清空数据表/载入空fixtures RDoc 解决同名module 与 Class的问题 C 实用的 e-editor 的bundle Best of Ruby Quiz - Animal Quiz Best of Ruby Quiz - GEDCOM Parser Best of Ruby Quiz - MadLib - Tachikoma 使用selenium-on-rails的一些讨论 3]assertXpathCount的使用 使用selenium-on-rails的一些讨论 2]清理缓存 - Tachikoma - 博客园 使用selenium-on-rails的一些讨论 [0,1] 关于 rails ActiveRecord 属性 以及 foreign_key 不直接用数据库项目 时的一些讨论
Ruby手工测试正确,rcov测试失败的解决
Tachikoma · 2008-10-16 · via 博客园 - Tachikoma

下述情况出现的几率非常小,但是碰到了又挺难理解

背景:

新安装的LEOPARD 上安装了新的ruby 1.8.7, 路径在/opt

gem 安装 rcov

现象:

正确

失败

分析:

分析了半天,突然想起来没有安装过rubygem

查看 gem 路径在/usr,也就是说gem 安装的包自动配制了/usr下系统安装的ruby,版本为1.8.6

解决:

下载并安装了新的rubygem,配制到/opt路径下,一切解决

验证:

分析认为是源代码中使用了1.8.7的新特性,验证如下

1.8.6

>> require 'set'
=> true
>> a = [[1].to_set,[2].to_set].to_set
=> #<Set: {#<Set: {2}>, #<Set: {1}>}>
>> a.include?([1].to_set)
=> false

1.8.7

irb(main):001:0> require 'set'
=> true
irb(main):
002:0> a = [[1].to_set,[2].to_set].to_set
=> #<Set: {#<Set: {1}>, #<Set: {2}>}>
irb(main):
003:0> a.include?([1].to_set)
=> true

差别就出来了,集合的集合对于包含元素的判别在两个版本中是不一致的