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

Groovy 3.0.5 regression with the "with" keyword

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.5, 2.5.13
    • 2.5.14, 3.0.6
    • None

    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

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

              Dates

                Created:
                Updated:
                Resolved: