Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lettuce
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
lettuce
Commits
c03383b6
Commit
c03383b6
authored
May 25, 2010
by
Gabriel Falcão
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some drafts at feature reference documentation
parent
796228fe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
116 additions
and
13 deletions
+116
-13
docs/conf.py
+0
-1
docs/reference/features.rst
+107
-3
docs/tutorial/simple.rst
+9
-9
No files found.
docs/conf.py
View file @
c03383b6
...
@@ -46,4 +46,3 @@ html_static_path = ["_static"]
...
@@ -46,4 +46,3 @@ html_static_path = ["_static"]
html_last_updated_fmt
=
'
%
b
%
d,
%
Y'
html_last_updated_fmt
=
'
%
b
%
d,
%
Y'
html_translator_class
=
"adjusts.LettuceHTMLTranslator"
html_translator_class
=
"adjusts.LettuceHTMLTranslator"
html_additional_pages
=
{}
html_additional_pages
=
{}
docs/reference/features.rst
View file @
c03383b6
.. _reference-features:
.. _reference-features:
=================
features, scenarios and steps reference
Feature reference
=======================================
=================
Features, scenarios and steps are python objects within lettuce's
feature engine.
Here you will find out very "hacky" details about those objects. If
you stumbled here looking for a introduction, it might be a good idea
to read :ref:`the feature tutorial <tutorial-simple>` for a
introduction.
Feature
~~~~~~~
The class `Feature` is at lettuce's core, and after parsed and
resolved from a feature file, you can use those members:
In order to exemplify the usage of attributes and methods below, let's
consider that there is a feature in a file called `some.feature`
.. highlight:: ruby
::
# language: en
# just a comment
# another one
Feature: some feature
Here comes
The feature
Description
Scenario: ...
...
Feature.described_at
^^^^^^^^^^^^^^^^^^^^
a FeatureDescription object, has the file and line which the feature
was described. Lettuce uses it to output those metadata.
the attribute `described_at` could be used as follows
::
# the line in which the feature started
feature.described_at.line == 5
# the filename path
'some.feature' in feature.described_at.file
# a tuple with the lines that contains the feature description
feature.described_at.description_at == (6, 7, 8)
Feature.max_length
^^^^^^^^^^^^^^^^^^
A property that calculates the max length of all lines that built the
feature.
Mostly used by shell output to find out where to print the feature
description.
example:
::
feature.max_length == 21
Feature.get_head
^^^^^^^^^^^^^^^^
does represent the feature with its first representation in current
language followed by a colon and the feature name.
example:
::
feature.get_head() == 'Feature: some feature'
but if the same feature would written in brazillian portuguese, for example:
.. highlight:: ruby
::
# language: pt-br
# apenas um comentário
# e outro
Funcionalidade: alguma funcionalidade
Aqui vem
a descrição
da funcionalidade
Cenário: ...
...
then, `Feature.get_head()` would give:
::
feature.get_head() == 'Funcionalidade: alguma funcionalidade'
docs/tutorial/simple.rst
View file @
c03383b6
...
@@ -72,15 +72,15 @@ Start describing the expected behaviour of factorial in `zero.feature` using Eng
...
@@ -72,15 +72,15 @@ Start describing the expected behaviour of factorial in `zero.feature` using Eng
::
::
Feature: Compute factorial
Feature: Compute factorial
In order to play with Lettuce
In order to play with Lettuce
As beginners
As beginners
We'll implement factorial
We'll implement factorial
Scenario: Factorial of 0
Scenario: Factorial of 0
Given I have the number 0
Given I have the number 0
When I compute its factorial
When I compute its factorial
Then I see the number 1
Then I see the number 1
.. Note::
.. Note::
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment