Uploaded image for project: 'Buildr (Retired)'
  1. Buildr (Retired)
  2. BUILDR-247

JtestR test framework does not pass configured system properties to runner (Cause: OpenObject does not work with Hash#only)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.3.3
    • 1.3.4
    • None
    • Ruby 1.8.6.

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            rsutphin Rhett Sutphin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: