Why ":symbol" failed but 'symbol' successed with JRuby 1.0.3?

Discussion in 'Ruby' started by Song Ma, Jun 18, 2008.

  1. Song Ma

    Song Ma Guest

    [Note: parts of this message were removed to make it a legal post.]

    Hi,

    I was running the test cases from Rails 1.2.6 Action Pack. The full text
    of test is here<http://svn.rubyonrails.org/rails/branches/1-2-stable/actionpack/test/controller/test_test.rb>.
    There is one case like this:

    def test_process_with_session_arg
    process :no_op, nil, { 'string' => 'value1', :symbol => 'value2' }
    assert_equal 'value1', session['string']
    assert_equal 'value1', session[:string]
    assert_equal 'value2', session['symbol']
    assert_equal 'value2', session[:symbol]
    end
    I was using JRuby 1.0.3 on a UNIX platform, to my surprised this case only
    first assert passed and all other three failed. The error message says
    "<value1> expected but was <nil>"

    After I changed ":symbol => 'value2' " to " 'symbol' => 'value2' ", assert 1
    and 3 passed but 2 and 4 were always failed. The error message was the same.

    These tests were passed on my Gentoo box with JRuby 1.0.3. The JVM are the
    same Java5.0.

    What could be wrong for it? Theoratically JRuby is platform independent and
    I was using the same version of JVM on both UNIX and Gentoo. Why 'symbol'
    works but :symbol failed?

    Thanks,
    Song Ma
     
    Song Ma, Jun 18, 2008
    #1
    1. Advertising

  2. Song Ma

    Roger Pack Guest

    Re: Why ":symbol" failed but 'symbol' successed with JRuby 1

    > What could be wrong for it? Theoratically JRuby is platform independent
    > and
    > I was using the same version of JVM on both UNIX and Gentoo. Why
    > 'symbol'
    > works but :symbol failed?

    might want to ask the jruby group
    -R
    --
    Posted via http://www.ruby-forum.com/.
     
    Roger Pack, Jun 19, 2008
    #2
    1. Advertising

  3. Song Ma wrote:
    > Hi,
    >
    > I was running the test cases from Rails 1.2.6 Action Pack. The full text
    > of test is here<http://svn.rubyonrails.org/rails/branches/1-2-stable/actionpack/test/controller/test_test.rb>.
    > There is one case like this:
    >
    > def test_process_with_session_arg
    > process :no_op, nil, { 'string' => 'value1', :symbol => 'value2' }
    > assert_equal 'value1', session['string']
    > assert_equal 'value1', session[:string]
    > assert_equal 'value2', session['symbol']
    > assert_equal 'value2', session[:symbol]
    > end
    > I was using JRuby 1.0.3 on a UNIX platform, to my surprised this case only
    > first assert passed and all other three failed. The error message says
    > "<value1> expected but was <nil>"
    >
    > After I changed ":symbol => 'value2' " to " 'symbol' => 'value2' ", assert 1
    > and 3 passed but 2 and 4 were always failed. The error message was the same.
    >
    > These tests were passed on my Gentoo box with JRuby 1.0.3. The JVM are the
    > same Java5.0.


    You really ought to be using JRuby 1.1.x...1.0.3 is the last maintenance
    release to 1.0 and that line has not seen any updates in over a year.
    1.1 just had a 1.1.3 release that's worlds better as far as
    compatibility and far faster. If this bug still exists in JRuby 1.1.3,
    please file an issue for it :)

    http://jira.codehaus.org/browse/JRUBY

    - Charlie
     
    Charles Oliver Nutter, Jul 20, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,993
    Smokey Grindel
    Dec 2, 2006
  2. Slim Baltagi
    Replies:
    0
    Views:
    404
    Slim Baltagi
    Dec 15, 2007
  3. Ronald Fischer
    Replies:
    2
    Views:
    210
    Scott Miller
    May 16, 2007
  4. Charles Oliver Nutter

    [JRuby] JRuby perf questions answered

    Charles Oliver Nutter, Oct 31, 2007, in forum: Ruby
    Replies:
    7
    Views:
    183
    Kevin Williams
    Nov 1, 2007
  5. Martin Krauskopf

    [ANN] [JRuby] Fast Debugger for JRuby

    Martin Krauskopf, Nov 11, 2007, in forum: Ruby
    Replies:
    0
    Views:
    133
    Martin Krauskopf
    Nov 11, 2007
Loading...

Share This Page