cucumber-attic / cucumber-ruby-spike-donotuse

Pure Ruby Cucumber (Cucumber 2.x)
MIT License
5 stars 0 forks source link

Ensure embeddability #5

Open aslakhellesoy opened 13 years ago

aslakhellesoy commented 13 years ago

One of the things we got wrong in cucumber1 was lack of embeddability. The only entry point is the CLI. It would be nice if cucumber-ruby had a very high level API so people can use it in their own apps/libs.

A builder interface would be neat:

cucumber = Cucumber.new
cucumber.with_features(features_dir).with_mappings(mappings_dir).with_format('pretty').with_output(STDOUT).run
mattwynne commented 13 years ago

+ 1000 !!

The lack of this is a major headache when refactoring in Cucumber 1.0 - the assumption of being run in a command-line program leaks out all over the place.

Ideally, I'd like to see them in two separate libraries, so there's a cucumber-core that contains all the guts of executing features, and a cucumber-console that's a GUI client of cucumber-core.

msassak commented 13 years ago

I like the builder API, and it is my top priority to make sure both that cucumber-ruby is embeddable as a library, and that it uses as little implicit global state as possible. One thing I've been considering is to break out the text mapper stuff into a separate stepping-stone library. We could possibly back-port the mapping DSL to Cucumber 1.0, and it would enforce the separation from the CLI.