• funkless_eck@sh.itjust.works
      link
      fedilink
      arrow-up
      4
      ·
      edit-2
      2 days ago

      I was expecting it to be a language. It looks like Cucumber is actually a kind of IDE and the language is Gherkin .

      Feature: Guess the word
      /# The first example has two steps 
      Scenario: Maker starts a game 
      When the Maker starts a game 
      Then the Maker waits for a Breaker to join 
      /# The second example has three steps 
      Scenario: Breaker joins a game 
      Given the Maker has started a game with the word "silky" 
      When the Breaker joins the Maker's game 
      Then the Breaker must guess a word with 5 characters
      • jtrek@startrek.website
        link
        fedilink
        arrow-up
        8
        ·
        2 days ago

        I kind of intensely dislike that whole… natural language wrapper thing. It adds at least one whole extra layer to maintain for no real benefit. No one non technical is going to read it. If they were some magic competent person, they could just read regular doc strings.

        • 9point6@lemmy.world
          link
          fedilink
          arrow-up
          3
          ·
          2 days ago

          That was always the fake dream that was sold, about 15 years ago there were a lot of people writing cukes

          I never saw a single business analyst or product owner ever open even one of those text files that ostensibly primarily only existed for their benefit.

          The closest we got was copy and pasting the user story from the ticket and hammering it into the shape of the existing regexes

          Then we all woke up from the fever dream about 10 years ago and I’ve basically not seen one since.

          Tbh with this AI bubble it’s only a matter of time before someone tries it again

          • jtrek@startrek.website
            link
            fedilink
            arrow-up
            3
            ·
            2 days ago

            I had an interview a few weeks ago (one of like 3 this year) where it was revealed they still write these.

            They asked how we kept all the stuff organized at my last job. All the cucumber stuff. I said we just kept the tests next to the file they’re testing- foo.py has a sibling test_foo.py- and we didn’t find much value in adding extra layers. If you want to test the API returns 403 when you request another user’s file, you can just write like

            
            def test_403_when_requesting_other_user_file() -> None:
              response = requests.get("whatever/etc")
              assert response.status_code == 403
            

            You can be pretty to the point.

            We used docstrings to explain non-obvious things. Swagger shows the API docs in a nice webpage for anyone curious and authorized.

            He wasn’t impressed and I didn’t make it to the next round.

            • 9point6@lemmy.world
              link
              fedilink
              arrow-up
              3
              ·
              edit-2
              2 days ago

              He wasn’t impressed and I didn’t make it to the next round.

              Poor Stockholm syndrome afflicted fool

              Breaks my heart to know people are still suffering this particular hell