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

Given, When, Then syntax #15

Open
digitalsadhu opened this issue Sep 10, 2014 · 0 comments
Open

Given, When, Then syntax #15

digitalsadhu opened this issue Sep 10, 2014 · 0 comments

Comments

@digitalsadhu
Copy link

I am pretty interested in using a similar DSL to rspec given and jasmine given but in php.
I was wondering about trying to write some sort of plugin for pecs to do this but not sure how doable such a thing would be.

Ideally tests would look like:

describe('assigning stuff to this', function () {
  given(function () { $this->number = 24; })
  given(function () { $this->number++; })
  when(function () { $this->number *= 2; })
  then(function () { expect($this->number).to_equal(50); })
})

Perhaps it would be possible to do some introspection and dependency injection of return values from previous given, when or then functions into following ones?

Any ideas?

Refs:

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

No branches or pull requests

1 participant