ESpec |> Elixir BDD
Anton Mishchuk
#pivorak 10
March 25, 2016
About me
- Ruby Developer at Matic Insurance Services Inc
- Big fan of Elixir programming language since 2014
- ESpec package creator & maintainer
- GitHub: antonmi
- Email: anton.mishchuk@gmail.com
How the idea was born
- We are from Ruby world
- We like BDD
- We like RSpec
- It would be perfect to have RSpec like BDD testing framework in Elixir!
Is it possible to implement RSpec DSL in Elixir?
- Chris McCord “Metaprogramming Elixir”
- Macros to the rescue
- Yes! It is possible!
- ESpec v0.1.0 was released on March 25, 2015
- Current ESpec version is 0.8.16
- hex.pm package: espec
- GitHub: antonmi/espec
Do you think this is RSpec code?
ESpec - BDD for Elixir
- Test organization with “describe”, “context”, “it”, and etc. blocks
- Familiar matchers “eq”, “be_close_to”, “raise_exception”, etc
- Custom matchers
- Three types of expectation syntax
- “Before” and “finally” blocks
- “let”, “let!” and “subject”
- Shared examples
- Mocking with Erlang “meck” library.
- Async examples
- Doc specs
- HTML and JSON formatted outputs
ESpec Phoenix
- ESpec configs, helpers and matchers to use it with Phoenix web framework
- Is on early stage of development. Current version is 0.2.0
- Contributors are welcomed
- Hex.pm package: espec_phoenix
- Github: antonmi/espec_phoenix
Thanks for your attention

Espec |> Elixir BDD

  • 1.
    ESpec |> ElixirBDD Anton Mishchuk #pivorak 10 March 25, 2016
  • 2.
    About me - RubyDeveloper at Matic Insurance Services Inc - Big fan of Elixir programming language since 2014 - ESpec package creator & maintainer - GitHub: antonmi - Email: anton.mishchuk@gmail.com
  • 3.
    How the ideawas born - We are from Ruby world - We like BDD - We like RSpec - It would be perfect to have RSpec like BDD testing framework in Elixir!
  • 4.
    Is it possibleto implement RSpec DSL in Elixir? - Chris McCord “Metaprogramming Elixir” - Macros to the rescue - Yes! It is possible! - ESpec v0.1.0 was released on March 25, 2015 - Current ESpec version is 0.8.16 - hex.pm package: espec - GitHub: antonmi/espec
  • 5.
    Do you thinkthis is RSpec code?
  • 6.
    ESpec - BDDfor Elixir - Test organization with “describe”, “context”, “it”, and etc. blocks - Familiar matchers “eq”, “be_close_to”, “raise_exception”, etc - Custom matchers - Three types of expectation syntax - “Before” and “finally” blocks - “let”, “let!” and “subject” - Shared examples - Mocking with Erlang “meck” library. - Async examples - Doc specs - HTML and JSON formatted outputs
  • 7.
    ESpec Phoenix - ESpecconfigs, helpers and matchers to use it with Phoenix web framework - Is on early stage of development. Current version is 0.2.0 - Contributors are welcomed - Hex.pm package: espec_phoenix - Github: antonmi/espec_phoenix
  • 8.
    Thanks for yourattention