google-code-export / ruby-activeldap

Automatically exported from code.google.com/p/ruby-activeldap
Other
1 stars 1 forks source link

Ruby 1.8.6 p287 :: Undefined methods #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Install Ruby 1.8.6 p287
{{{
# wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.6-p287.tar.bz2
# tar xjpf ruby-1.8.6-p287.tar.bz2
# cd ruby-1.8.6-p287
# ./configure
# make && make install
}}}
2. Get Ruby/LDAP from svn and install
{{{
# svn checkout http://ruby-activeldap.googlecode.com/svn/ldap/trunk
ruby-ldap-ro
# cd ruby-ldap-ro
# ruby extconf.rb
# make && make install
}}}
3. Install Ruby/ActiveLdap from svn and running tests
{{{
# svn checkout http://ruby-activeldap.googlecode.com/svn/trunk/
ruby-activeldap-ro
# cd ruby-activeldap-ro
# cp test/config.yaml.sample test/config.yaml
[ Configure test/config.yaml ]
# cat test/config.yaml
test:
  host: 127.0.0.1
  port: 389
  base: dc=127.0.0.1
  bind_dn: ""
  try_sasl: true
  method: :plain
  sasl_mechanisms: ["GSSAPI"]
  allow_anonymous: false
# ruby test/run-test.rb > ../ruby186_r905_run-test.log
}}}

What is the expected output? What do you see instead?
Some like results of tests on Ruby 1.9.1:

---
312 tests, 875 assertions, 0 failures, 0 errors, 0 pendings, 1 omissions, 0
notifications

---

But gives errors:
1) Undefined method 'lines' for String
2) Undefined method 'self_and_descendents_from_active_record' for Class

Attached log maybe not full (I will attach log with full  test results)

Original issue reported on code.google.com by Alexey.Chebotar@gmail.com on 20 Mar 2009 at 11:57

Attachments:

GoogleCodeExporter commented 9 years ago
Sorry for that. 
I used to Redmine before GoogleCode... :(
I'm afraid to change your code alone :)

Original comment by Alexey.Chebotar@gmail.com on 20 Mar 2009 at 12:16

GoogleCodeExporter commented 9 years ago
Please see full log in attach.

Original comment by Alexey.Chebotar@gmail.com on 20 Mar 2009 at 1:39

Attachments:

GoogleCodeExporter commented 9 years ago
Maybe, I've fixed it in trunk.

Original comment by kou...@gmail.com on 20 Mar 2009 at 2:38

GoogleCodeExporter commented 9 years ago
Thanks. I will make tests of this, after completing tests on ruby 1.8.7 p27 :)

Original comment by Alexey.Chebotar@gmail.com on 20 Mar 2009 at 3:10

GoogleCodeExporter commented 9 years ago
Results of tests on Ruby 1.8.7 p72:
---
Finished in 2646.78688 seconds.

  1) Omission: requires permission for searching by 'uid' to anonymous user.
test_bind(TestConnectionPerDN)
./test/test_connection_per_dn.rb:59:in `test_bind'
/root/ruby-activeldap-ro/test/al-test-utils.rb:270:in `make_temporary_user'
/root/ruby-activeldap-ro/test/al-test-utils.rb:249:in `make_temporary_user'
/root/ruby-activeldap-ro/test/al-test-utils.rb:296:in `ensure_delete_user'
/root/ruby-activeldap-ro/test/al-test-utils.rb:244:in `make_temporary_user'
./test/test_connection_per_dn.rb:38:in `test_bind'

185 tests, 492 assertions, 0 failures, 0 errors, 0 pendings, 1 omissions, 0 
notifications
---
Why only 185 tests ? :]

Original comment by Alexey.Chebotar@gmail.com on 20 Mar 2009 at 4:22

GoogleCodeExporter commented 9 years ago
I've fixed "Undefined method 'lines' for String" in trunk. I hope this not a 
problem? :)
I've tested this code on Ruby 1.8.6 and 1.8.7 in irb:
---irb(main):001:0> RUBY_VERSION
=> "1.8.6"
irb(main):002:0>     if "".respond_to?(:lines)
irb(main):003:1>       def string_to_lines(string)
irb(main):004:2>         string.lines.to_a
irb(main):005:2>       end
irb(main):006:1>     else
irb(main):007:1*       def string_to_lines(string)
irb(main):008:2>         ary = []
irb(main):009:2>         string.each_line{|l| ary << l}
irb(main):010:2>         ary
irb(main):011:2>       end
irb(main):012:1>     end
=> nil
irb(main):013:0> string_to_lines("a\n\nb\n")
=> ["a\n", "\n", "b\n"]
irb(main):014:0> string_to_lines("a\n\nb\n").size
=> 3
---
irb(main):001:0> RUBY_VERSION
=> "1.8.7"
irb(main):002:0>     if "".respond_to?(:lines)
irb(main):003:1>       def string_to_lines(string)
irb(main):004:2>         string.lines.to_a
irb(main):005:2>       end
irb(main):006:1>     else
irb(main):007:1*       def string_to_lines(string)
irb(main):008:2>         ary = []
irb(main):009:2>         string.each_line{|l| ary << l}
irb(main):010:2>         ary
irb(main):011:2>       end
irb(main):012:1>     end
=> nil
irb(main):013:0> string_to_lines("a\n\nb\n")
=> ["a\n", "\n", "b\n"]
irb(main):014:0> string_to_lines("a\n\nb\n").size
=> 3
---
All tests are passed.
Logs of tests attached

Original comment by Alexey.Chebotar@gmail.com on 20 Mar 2009 at 10:02

Attachments:

GoogleCodeExporter commented 9 years ago
Tests are passed on ruby 1.9.1 p0
But I don't understand why always different count of tests? :-\

Original comment by Alexey.Chebotar@gmail.com on 21 Mar 2009 at 12:18

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for fixing it.

It's the reason "why always different count of tests" that test/run-test.rb add
--priority-mode option implicitly. (Oops, I didn't write documents for
--priority-mode in Test::Unit 2.x documents... I hope that someone helps me to 
write
Test::Unit 2.x documents in English...) In the mode, ran tests are selected
stochastically and test priority and "whether a test is failed in the previous 
test"
are used on selecting tests. (You will find "priority :must" and "priority 
normal" in
test codes.)

ActiveLdap test suits are takes long time. It blocks quick "write test" - "run 
test"
- "write code" - "run test" - ... cycle. So, ActiveLdap runs only selected 
tests by
default. You can run all test with the following tests:

  % test/run-test.rb --no-priority-mode

Original comment by kou...@gmail.com on 21 Mar 2009 at 1:28

GoogleCodeExporter commented 9 years ago
Maybe I will help you with documents in future, but my English not so great... 
I will
learn it stronger :)
I need to study code of libraries Ruby/LDAP and Ruby/ActiveLdap before writing
documents (in Russian and English) ;)
I will check tests on all versions of Ruby, with "--no-priority-mode" option.

Original comment by Alexey.Chebotar@gmail.com on 21 Mar 2009 at 11:07

GoogleCodeExporter commented 9 years ago
Wow! Very thanks!
You're a very active developer!!!

Original comment by kou...@gmail.com on 21 Mar 2009 at 3:51

GoogleCodeExporter commented 9 years ago
Fanatical mode: On :)
All tests are passed :)
On ruby 1.8.6 p287:
---
  Finished in 2670.720477 seconds.
  312 tests, 875 assertions, 0 failures, 0 errors, 0 pendings, 1 omissions, 0
notifications
---
On Ruby 1.8.7 p27:
---
  Finished in 2656.195123 seconds.
  312 tests, 875 assertions, 0 failures, 0 errors, 0 pendings, 1 omissions, 0
notifications
---
On Ruby 1.9.1 p0:
---
  Finished in 3404.351493375 seconds.
  312 tests, 875 assertions, 0 failures, 0 errors, 0 pendings, 1 omissions, 0
notifications
---
Strange time... :-\

Original comment by Alexey.Chebotar@gmail.com on 21 Mar 2009 at 6:01

GoogleCodeExporter commented 9 years ago
Umm, the performance issue should be treated separate issue.
There is a benchmark script:
  % cp benchmark/config.yaml{.sample,}
  % vim benchmark/config.yaml
  % ruby benchmark/bench-al.rb --config benchmark/config.yaml

Original comment by kou...@gmail.com on 22 Mar 2009 at 1:37