While working on PR https://github.com/theforeman/foreman/pull/1040, I was getting test failures with Ruby 1.8.7
It turns out that the method .instance returns an array of strings in Ruby 1.8.7 and an array of symbols in Ruby 1.9.3.
1.9.3 > Domain.instance_methods => [… , :hosts, :host_ids, :hosts=, :host_ids=, :hostgroups, :hostgroup_ids, :hostgroups=, :hostgroup_ids=,…]
1.8.7 > Domain.instance_methods => [… , "hosts", "host_ids", "hosts=", "host_ids=", "hostgroups", "hostgroup_ids", "hostgroups=", "hostgroup_ids=",…]
Just an FYI if you use this method in the future.
Regards,
Joseph
This distinction between 1.8.7 and 1.9.3 holds for any method that
return methods, including (from the top of my head): methods,
public_methods, etc
-d
···
On Thu, Nov 28, 2013 at 8:19 AM, Joseph Magen wrote:
> While working on PR https://github.com/theforeman/foreman/pull/1040, I was getting test failures with Ruby 1.8.7
>
> It turns out that the method .instance returns an array of **strings** in Ruby 1.8.7 and an array of **symbols** in Ruby 1.9.3.
>
> 1.9.3 > Domain.instance_methods => [..... , :hosts, :host_ids, :hosts=, :host_ids=, :hostgroups, :hostgroup_ids, :hostgroups=, :hostgroup_ids=,....]
>
> 1.8.7 > Domain.instance_methods => [..... , "hosts", "host_ids", "hosts=", "host_ids=", "hostgroups", "hostgroup_ids", "hostgroups=", "hostgroup_ids=",....]
>
> Just an FYI if you use this method in the future.
>
> Regards,
>
> Joseph
>
> --
> You received this message because you are subscribed to the Google Groups "foreman-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to foreman-dev+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.