You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by "Rhett Sutphin (JIRA)" <ji...@apache.org> on 2009/02/10 05:14:59 UTC
[jira] Created: (BUILDR-247) JtestR test framework does not pass
configured system properties to runner (Cause: OpenObject does not work
with Hash#only)
JtestR test framework does not pass configured system properties to runner (Cause: OpenObject does not work with Hash#only)
---------------------------------------------------------------------------------------------------------------------------
Key: BUILDR-247
URL: https://issues.apache.org/jira/browse/BUILDR-247
Project: Buildr
Issue Type: Bug
Components: Core features, Test frameworks
Environment: Ruby 1.8.6.
Reporter: Rhett Sutphin
Fix For: 1.3.3
Properties configured with test.using(:jtestr, :properties => { ... }) are not actually passed to the tests when they run.
Digging into the cause, it appears to come from Buildr::TestFramework::JRubyBased#run, so rspec testing is probably also affected. The root cause is that Hash#only doesn't work if the hash is an OpenObject. Here's a spec that fails:
describe "Hash#only" do
it "works with OpenObjects" do
OpenObject.new({:a => 1, :b => 2, :c => 3}).only(:a).should == { :a => 1 }
end
end
The result of only(:a) is actually an empty hash because OpenObject doesn't delegate has_key? to @hash. It seems like OpenObject either needs to delegate all of Hash's methods to it's internal @hash or it needs to get rid of it.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (BUILDR-247) JtestR test framework does not pass
configured system properties to runner (Cause: OpenObject does not work
with Hash#only)
Posted by "Assaf Arkin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BUILDR-247?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Assaf Arkin resolved BUILDR-247.
--------------------------------
Resolution: Fixed
> JtestR test framework does not pass configured system properties to runner (Cause: OpenObject does not work with Hash#only)
> ---------------------------------------------------------------------------------------------------------------------------
>
> Key: BUILDR-247
> URL: https://issues.apache.org/jira/browse/BUILDR-247
> Project: Buildr
> Issue Type: Bug
> Components: Core features, Test frameworks
> Affects Versions: 1.3.3
> Environment: Ruby 1.8.6.
> Reporter: Rhett Sutphin
> Fix For: 1.3.4
>
> Attachments: 0001-Fix-BUILDR-247-redefine-OpenObject-without-a-delega.patch
>
>
> Properties configured with test.using(:jtestr, :properties => { ... }) are not actually passed to the tests when they run.
> Digging into the cause, it appears to come from Buildr::TestFramework::JRubyBased#run, so rspec testing is probably also affected. The root cause is that Hash#only doesn't work if the hash is an OpenObject. Here's a spec that fails:
> describe "Hash#only" do
> it "works with OpenObjects" do
> OpenObject.new({:a => 1, :b => 2, :c => 3}).only(:a).should == { :a => 1 }
> end
> end
> The result of only(:a) is actually an empty hash because OpenObject doesn't delegate has_key? to @hash. It seems like OpenObject either needs to delegate all of Hash's methods to it's internal @hash or it needs to get rid of it.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (BUILDR-247) JtestR test framework does not pass
configured system properties to runner (Cause: OpenObject does not work
with Hash#only)
Posted by "Rhett Sutphin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BUILDR-247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12672162#action_12672162 ]
Rhett Sutphin commented on BUILDR-247:
--------------------------------------
Also, here's a monkeypatch you can use to get this fix if you need it before a new release:
# Monkeypatch OpenObject to fix BUILDR-247
class OpenObject < Hash
def initialize(source=nil, &block)
super(&block)
update(source) if source
end
%w([] []= delete to_hash).each do |n|
define_method n do
super
end
end
end
> JtestR test framework does not pass configured system properties to runner (Cause: OpenObject does not work with Hash#only)
> ---------------------------------------------------------------------------------------------------------------------------
>
> Key: BUILDR-247
> URL: https://issues.apache.org/jira/browse/BUILDR-247
> Project: Buildr
> Issue Type: Bug
> Components: Core features, Test frameworks
> Affects Versions: 1.3.3
> Environment: Ruby 1.8.6.
> Reporter: Rhett Sutphin
> Attachments: 0001-Fix-BUILDR-247-redefine-OpenObject-without-a-delega.patch
>
>
> Properties configured with test.using(:jtestr, :properties => { ... }) are not actually passed to the tests when they run.
> Digging into the cause, it appears to come from Buildr::TestFramework::JRubyBased#run, so rspec testing is probably also affected. The root cause is that Hash#only doesn't work if the hash is an OpenObject. Here's a spec that fails:
> describe "Hash#only" do
> it "works with OpenObjects" do
> OpenObject.new({:a => 1, :b => 2, :c => 3}).only(:a).should == { :a => 1 }
> end
> end
> The result of only(:a) is actually an empty hash because OpenObject doesn't delegate has_key? to @hash. It seems like OpenObject either needs to delegate all of Hash's methods to it's internal @hash or it needs to get rid of it.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (BUILDR-247) JtestR test framework does not pass
configured system properties to runner (Cause: OpenObject does not work
with Hash#only)
Posted by "Rhett Sutphin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BUILDR-247?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rhett Sutphin updated BUILDR-247:
---------------------------------
Attachment: 0001-Fix-BUILDR-247-redefine-OpenObject-without-a-delega.patch
git generated patch which fixes OpenObject by removing the @hash delegate. Specs included.
This patch is also on github: http://github.com/rsutphin/buildr/commit/3379cd7ef1644718f3b37b5c6662eca87aed59a6
> JtestR test framework does not pass configured system properties to runner (Cause: OpenObject does not work with Hash#only)
> ---------------------------------------------------------------------------------------------------------------------------
>
> Key: BUILDR-247
> URL: https://issues.apache.org/jira/browse/BUILDR-247
> Project: Buildr
> Issue Type: Bug
> Components: Core features, Test frameworks
> Affects Versions: 1.3.3
> Environment: Ruby 1.8.6.
> Reporter: Rhett Sutphin
> Attachments: 0001-Fix-BUILDR-247-redefine-OpenObject-without-a-delega.patch
>
>
> Properties configured with test.using(:jtestr, :properties => { ... }) are not actually passed to the tests when they run.
> Digging into the cause, it appears to come from Buildr::TestFramework::JRubyBased#run, so rspec testing is probably also affected. The root cause is that Hash#only doesn't work if the hash is an OpenObject. Here's a spec that fails:
> describe "Hash#only" do
> it "works with OpenObjects" do
> OpenObject.new({:a => 1, :b => 2, :c => 3}).only(:a).should == { :a => 1 }
> end
> end
> The result of only(:a) is actually an empty hash because OpenObject doesn't delegate has_key? to @hash. It seems like OpenObject either needs to delegate all of Hash's methods to it's internal @hash or it needs to get rid of it.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (BUILDR-247) JtestR test framework does not pass
configured system properties to runner (Cause: OpenObject does not work
with Hash#only)
Posted by "Rhett Sutphin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/BUILDR-247?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rhett Sutphin updated BUILDR-247:
---------------------------------
Fix Version/s: (was: 1.3.3)
Affects Version/s: 1.3.3
> JtestR test framework does not pass configured system properties to runner (Cause: OpenObject does not work with Hash#only)
> ---------------------------------------------------------------------------------------------------------------------------
>
> Key: BUILDR-247
> URL: https://issues.apache.org/jira/browse/BUILDR-247
> Project: Buildr
> Issue Type: Bug
> Components: Core features, Test frameworks
> Affects Versions: 1.3.3
> Environment: Ruby 1.8.6.
> Reporter: Rhett Sutphin
>
> Properties configured with test.using(:jtestr, :properties => { ... }) are not actually passed to the tests when they run.
> Digging into the cause, it appears to come from Buildr::TestFramework::JRubyBased#run, so rspec testing is probably also affected. The root cause is that Hash#only doesn't work if the hash is an OpenObject. Here's a spec that fails:
> describe "Hash#only" do
> it "works with OpenObjects" do
> OpenObject.new({:a => 1, :b => 2, :c => 3}).only(:a).should == { :a => 1 }
> end
> end
> The result of only(:a) is actually an empty hash because OpenObject doesn't delegate has_key? to @hash. It seems like OpenObject either needs to delegate all of Hash's methods to it's internal @hash or it needs to get rid of it.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.