Arturas Slajus created JRUBY-6377:
-------------------------------------
Summary: rspec .should include() fails in --1.9 mode
Key: JRUBY-6377
URL: https://jira.codehaus.org/browse/JRUBY-6377
Project: JRuby
Issue Type: Bug
Components: Ruby 1.9.2
Affects Versions: JRuby 1.6.6
Environment: arturas@zeus:~/work$ jruby -v --1.9
jruby 1.6.6.dev (ruby-1.9.2-p312) (2012-01-24 87afe49) (Java HotSpot(TM) Client
VM 1.7.0) [linux-i386-java]
arturas@zeus:~/work$ gem list
*** LOCAL GEMS ***
activemodel (3.0.11)
activerecord (3.0.11)
activerecord-jdbc-adapter (1.2.1)
activerecord-jdbcmysql-adapter (1.2.1)
activerecord-jdbcsqlite3-adapter (1.2.1)
activesupport (3.0.11)
arel (2.0.10)
awesome_print (1.0.2, 1.0.1)
bouncy-castle-java (1.5.0146.1)
builder (2.1.2)
bundle (0.0.1)
bundler (1.0.21)
chronic (0.6.6)
coderay (0.9.8)
diff-lcs (1.1.3)
eventmachine (0.12.10 java)
factory_girl (2.1.2)
i18n (0.5.0)
jdbc-mysql (5.1.13)
jdbc-sqlite3 (3.7.2)
jruby-launcher (1.0.12 java java)
jruby-openssl (0.7.5, 0.7.4)
json (1.6.3 java)
mail (2.3.0)
mediawiki-gateway (0.4.3)
metaclass (0.0.1)
method_source (0.6.7)
mime-types (1.17.2)
minitar (0.5.3)
mocha (0.10.3)
net-scp (1.0.4)
net-sftp (2.0.5)
net-ssh (2.2.1)
polyglot (0.3.3)
pry (0.9.7.4 java)
rake (0.9.2.2 ruby)
rest-client (1.6.7)
rspec (2.7.0)
rspec-core (2.7.1)
rspec-expectations (2.7.0)
rspec-mocks (2.7.0)
ruby_parser (2.3.1)
sexp_processor (3.0.9)
slop (2.1.0)
spoon (0.0.1)
treetop (1.4.10)
tzinfo (0.3.31)
xml-simple (1.1.1)
Reporter: Arturas Slajus
Assignee: Thomas E Enebo
Priority: Critical
When in 1.9 mode rspec include matcher fails mysteriously
{noformat}
arturas@zeus:~/work$ jruby --1.8 -S rspec rspec_include_test.rb
== CreatePlanet: migrating ===================================================
-- create_table(:planets)
-> 0.1020s
-> 0 rows
== CreatePlanet: migrated (0.1040s) ==========================================
.
Finished in 3.12 seconds
1 example, 0 failures
arturas@zeus:~/work$ jruby --1.9 -S rspec rspec_include_test.rb
== CreatePlanet: migrating ===================================================
-- create_table(:planets)
-> 0.1110s
-> 0 rows
== CreatePlanet: migrated (0.1130s) ==========================================
F
Failures:
1) failing array include test should not fail
Failure/Error: Planet.scoped.should include(p2)
NoMethodError:
undefined method `include?' for #<Planet id: 1>
# ./rspec_include_test.rb:32:in `(root)'
Finished in 3.1 seconds
1 example, 1 failure
Failed examples:
rspec ./rspec_include_test.rb:28 # failing array include test should not fail
{noformat}
Test code:
{noformat}
require 'rubygems'
require 'rspec'
require 'active_record'
db = "respec_include_test.sqlite3"
File.unlink(db) if File.exists?(db)
cfg = {
"adapter" => RUBY_PLATFORM == 'java' ? "jdbcsqlite3" : 'sqlite3',
"database" => db,
"timeout" => 5000
}
ActiveRecord::Base.establish_connection(cfg)
c = ActiveRecord::Base.connection
class CreatePlanet < ActiveRecord::Migration
def self.up
create_table :planets
end
end
CreatePlanet.migrate(:up)
class Planet < ActiveRecord::Base
end
describe "failing array include test" do
it "should not fail" do
p1 = Planet.create
p2 = Planet.create
p3 = Planet.create
Planet.scoped.should include(p2)
end
end
{noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email