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

Add hooks and use them in capybara #28

Merged
merged 1 commit into from
Oct 2, 2011
Merged

Add hooks and use them in capybara #28

merged 1 commit into from
Oct 2, 2011

Conversation

josepjaume
Copy link
Contributor

Now we can do things like:

Feature "A cool feature" do
  before do |name|
    make_something_with_the_name
  end
  after do |name|
    notify_step_has_finished
  end
  before_scenario do |name|
    ...
  end
  before_step do |keyword, name|
    ...
  end
end

Or more simply:

Spinach::Feature.before do
  will_run_before_every_feature
end
Spinach::Feature.before_step do |keyword, name|
  will_run_before_every_step
end

Cool, huh?

josepjaume added a commit that referenced this pull request Oct 2, 2011
@josepjaume josepjaume merged commit b6849ff into master Oct 2, 2011
@@ -24,4 +29,20 @@ describe Spinach::Feature::Capybara do
page = @feature.go_home
page.has_content?('Hello world').must_equal true
end
it "resets the capybara session after each scenario" do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you gonna add new lines any day?

@oriolgual
Copy link
Member

We should start writing a readme or write more integration tests because there is nothing documented.

@josepjaume
Copy link
Contributor Author

Sorry, i didn't document the hooks. Everything else is, but a feature
summary document would be useful.
El 02/10/2011 11:54, "Oriol Gual" <
reply@reply.github.com>
escribió:

We should start writing a readme or write more integration tests because
there is nothing documented.

Reply to this email directly or view it on GitHub:
#28 (comment)

@oriolgual
Copy link
Member

But I mean something to explain how to use Spinach. Now almost everything is documented but there's no guide or examples on how to use Spinach as a whole.

@josepjaume
Copy link
Contributor Author

Great!
Josep Jaume

On Sun, Oct 2, 2011 at 1:20 PM, Oriol Gual <
reply@reply.github.com>wrote:

But I mean something to explain how to use Spinach. Now almost everything
is documented but there's no guide or examples on how to use Spinach as a
whole.

Reply to this email directly or view it on GitHub:
#28 (comment)

@txus
Copy link
Member

txus commented Oct 2, 2011

I don't quite see the use of step-side hooks! Could you give me a couple examples?

@josepjaume
Copy link
Contributor Author

Well, for example that feature oriol was working on cucumber: Taking screenshots of every step so you have a complete graphical documentation. Also, statistics, etc...

What do you think?

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

Successfully merging this pull request may close these issues.

3 participants