i have a Rack app like this:
app = Rack::Builder.new do
map '/' do
# ...
end
map '/edit' do
# ...
end
end.to_app
How would i test it without long-tail installation/setup/learn process.
RSpec and minitest are really great, but i do not really want to learn nor setup them.
Is there something i cat just plug in and write/run tests right away in plain Ruby?
I want to write tests as simple as i wrote the app above, without advanced techniques and gotchas.
In KISS I Trust!
you can try
Specular+Sonarbundle.Specularis for writing tests anywhere you need them.Sonaris a mock “browser” that communicate to your app, just likerack-testdoes, but with some unique features and simpler workflow.Using them is as simple as:
so you put your specs right beside your app and write tests quickly in plain Ruby, without having to learn anything.
see the full example running at CIBox
(if it does not run automatically, click Run button)
PS: writing Rack apps this way is kinda a pain.
You can try a mapper, like
Appetiteone.so your app may look like this:
see the same example but with app built by
Appetitehere