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

Test framework for IEx #919

Closed
alco opened this issue Apr 5, 2013 · 9 comments
Closed

Test framework for IEx #919

alco opened this issue Apr 5, 2013 · 9 comments
Assignees

Comments

@alco
Copy link
Member

alco commented Apr 5, 2013

Since most helpers are IO based, we can test it with a bash script.

Or set up a mock IO module that would send output to another process where we can check it against reference?

Update
I've renamed this to "Test framework for IEx". We can now write tests for some of the parts of IEx that haven't been automatically checked for regressions previously.

The purpose of this issue is:

  • define the areas of IEx functionality that need to be automatically checked
  • provide convenience macros/functions to reduce the amount boilerplate when writing such tests

Areas of interest I can point out are:

  • check for proper exception catching
  • test #iex:break
  • test some or all of the helpers
@yrashk
Copy link
Contributor

yrashk commented Apr 5, 2013

I'd rather replace the group leader to do this

@josevalim
Copy link
Member

We can replace the group leader or have something like meck (for mocking IO calls). I think a mechanism for replacing the group leader will be needed in exunit sooner than later though.

@josevalim
Copy link
Member

One option is to read the IO module used from :application.get_env(:iex, :io). Then the test can set it to something else, for example, a simple implementation that pushes stuff to the current process queue, like in the Mix.shell.

@alco
Copy link
Member Author

alco commented May 17, 2013

This is partially implemented by #1059. Once we have the ability to mock use input, we can either close this one, or provide a helper itest macro dedicated to interactive testing:

def IExTests do
  use ExUnit.Case

  itest "input errors",
    input: "...",
    expected_output: "...",
    options: [:no_color]
end

@alco
Copy link
Member Author

alco commented May 21, 2013

@mururu How is the work on updated capture_io going?

@mururu
Copy link
Contributor

mururu commented May 22, 2013

@alco I am woking on it now, but it is more difficult than I thought. Please wait for a few days.

@alco
Copy link
Member Author

alco commented May 22, 2013

See updated issue description.

Areas of interest I can point out are:

  • check for proper exception catching
  • test #iex:break
  • test some or all of the helpers

@alco
Copy link
Member Author

alco commented May 24, 2013

Also

  • test that .iex files are working properly

@ghost ghost assigned alco May 28, 2013
@josevalim
Copy link
Member

Closed in favor of #1137.

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

No branches or pull requests

4 participants