Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e2e testing doesn't feel good #59

Open
matti opened this issue Dec 16, 2019 · 1 comment
Open

e2e testing doesn't feel good #59

matti opened this issue Dec 16, 2019 · 1 comment

Comments

@matti
Copy link

matti commented Dec 16, 2019

adding method_option :services, type: :boolean

causes tests (correctly) to fail:

  1) `test-cmd config` command executes `test-cmd help config` command successfully
     Failure/Error: expect(output).to eq(expected_output)

       expected: "Usage:\n  test-cmd config\n\nOptions:\n  -h, [--help], [--no-help]  # Display usage information\n\nCommand description...\n"
            got: "Usage:\n  test-cmd config\n\nOptions:\n  -h, [--help], [--no-help]          # Display usage information\n      [--services], [--no-services]  \n\nCommand description...\n"

and then when I copy/paste the output in

    expected_output = <<-OUT
Usage:
  test-cmd config

Options:
  -h, [--help], [--no-help]          # Display usage information
      [--services], [--no-services]

Command description...
    OUT

and I re-run the tests I get:

     Failure/Error: expect(output).to eq(expected_output)

       expected: "Usage:\n  test-cmd config\n\nOptions:\n  -h, [--help], [--no-help]          # Display usage information\n      [--services], [--no-services]\n\nCommand description...\n"
            got: "Usage:\n  test-cmd config\n\nOptions:\n  -h, [--help], [--no-help]          # Display usage information\n      [--services], [--no-services]  \n\nCommand description...\n"

And I'm giving up because this just feels stupid way to test and adjust whitespaces.

@matti matti changed the title adding option and tests e2e testing doesn't feel good Dec 16, 2019
@piotrmurach
Copy link
Owner

Hi Matti,

Thanks for reporting this!

Well, testing strings can be a frustrating given that one character can make the whole thing fail. The rspec doesn't make it easy to compare things either, it can hide invisible characters. I'm always open to improving things, and want to know how better the end-to-end testing can be done?

As always it's not the lack of ideas but time that prevents me from improving things. Let's hope next year will bring more time and opportunities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants