Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-9655

Groovy 3.0.5 regression with the "with" keyword

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 3.0.5, 2.5.13
    • Fix Version/s: 2.5.14, 3.0.6
    • Component/s: None
    • Labels:

      Description

      Since GROOVY-7701 was the only issue relating to with in Groovy 3.0.5, I think that fix might have broken behaviour in Spock (using 2.0-M3):

      This works in 3.0.4:

      static BOOKING = 123
      def 'get stuff'() {
        given:
        def stuff = [ booking: 123 ]
      
        expect:
          with(stuff) {
            booking == BOOKING
          }
       }
      

      But fails in 3.0.5 with:

      Condition not satisfied:
      booking == BOOKING
      |       |  |
      123     |  null
              false
      
      

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                emilles Eric Milles
                Reporter:
                monti Henrik
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: