lucaspiller / espec Goto Github PK
View Code? Open in Web Editor NEWESpec: Behaviour driven development framework for Erlang
License: MIT License
ESpec: Behaviour driven development framework for Erlang
License: MIT License
i don't think we actually need the parse transform. i think we can have the same syntax and use the imported function feature.
Possible related to the first answer mentioned on jimenezrick/vimerl#7
Auto indenting ends up with:
spec() ->
describe("beforespec", fun() ->
it("should do stuff", fun() ->
io:format("output from: it should do stuff~n", [])
end),
end).
It should be:
spec() ->
describe("beforespec", fun() ->
it("should do stuff", fun() ->
io:format("output from: it should do stuff~n", [])
end),
end).
rspec like instance variables
we should be able to support
Foo@ = setup_variable()
do_stuff_with(Foo@)
is that syntax too weird?
not sure exactly how this should work with before/after each/all
alternative 1)
each group/example creates its own variable context which is a copy of the outer variable context. this means examples/groups on the same level won't interfere with each other. but it also means an after_all in a group will only see variables set by a before_all in the same group or an outer group which limits what an after_all can clean up. i think that makes sense.
alternative 2)
do whatever rspec does...
Like the pending
method in RSpec
we should have a thing that just automatically unloads all the mechs you have defined in a before or in an example.
for example
describe("foo", fun() ->
before_each(fun() ->
%load mech 1
end),
it("should do stuff", fun() ->
end),
describe("nested", fun() ->
before_each(fun() ->
% load mech 2
end),
it("should do more stuff", fun() ->
end),
end)
end)
is converted to
load mech 1
run "should do stuff"
unload mech 1
load mech 1
load mech 2
run "should do more stuff"
unload mech 2
unload mech 1
we should probably provide an option to auto-verify as well.
not sure if mech already has something to make this easy...
https://travis-ci.org/lucaspiller/twerl/jobs/6906895
./espec spec
=ERROR REPORT==== 5-May-2013::22:35:13 ===
Loading of /home/travis/build/lucaspiller/twerl/espec/espec.beam failed: badfile
escript: exception error: undefined function espec:main/1
in function escript:run/2
in call from escript:start/1
in call from init:start_it/1
in call from init:start_em/1
=ERROR REPORT==== 5-May-2013::22:35:13 ===
beam/beam_load.c(1365): Error loading module espec:
use of opcode 153; this emulator supports only up to 152
make: *** [spec] Error 127
The command "make spec" exited with 2.
https://travis-ci.org/lucaspiller/espec/jobs/50981443#L107-L108
spec/error_handling_spec.erl:165: no clause will ever match
spec/error_handling_spec.erl:165: the guard for this clause evaluates to 'false'
I want to make a standalone binary so it is easier to use in other projects. I used rebar escriptize
in c5f15ec, which worked to generate a standalone binary, except that isn't enough.
The parse transform we have in include/espec.hrl
also needs to be shared in the other projects, as spec files include it at the top.
We need to find a way to either not require this to be included and have the espec command do the work, or for the espec command to add this to the lib path before running specs (I guess it could write a temporary directory, then add that to the lib path).
Asserts like eunit, for example assertEqual, which when fail show you what was expected and what was returned. At the moment just a badmatch error is shown.
E.g.
Finished in 4.2 seconds
10 succeeded, 5 pending, 2 failures
I'm trying to use espec as a dep of my rebar project and I'm not sure how to use the command line tool. I've been using ./deps/espec/bin/espec
but that seems to fail.
E.g.
before_all(fun() ->
% {undefined_module, nonexistant_module}
ok = meck:new(nonexistant_module, [passthrough])
end),
Probably also happens in before_each
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.