freshen-0.2/0000755000175000017500000000000011373554245012030 5ustar romanromanfreshen-0.2/examples/0000755000175000017500000000000011373554245013646 5ustar romanromanfreshen-0.2/examples/befriending/0000755000175000017500000000000011373554245016122 5ustar romanromanfreshen-0.2/examples/befriending/friends.py0000644000175000017500000000107611373554046020131 0ustar romanromanclass User(object): def __init__(self, name): self.name = name self.friends = [] def befriend(self, other): if other.name not in self.friends: self.friends.append(other.name) if not other.is_friends_with(self): other.befriend(self) def is_friends_with(self, other): return other.name in self.friends users = { 'paxton': User('paxton'), 'adelaide': User('adelaide'), 'hazel': User('hazel'), 'duane': User('duane') } def find_user(name): return users.get(name) freshen-0.2/examples/befriending/features/0000755000175000017500000000000011373554245017740 5ustar romanromanfreshen-0.2/examples/befriending/features/befriending.feature0000644000175000017500000000033611373554046023572 0ustar romanromanFeature: befriending Scenario: befriending When user duane befriends user adelaide Then user duane should be friends with user adelaide And user adelaide should be friends with user duane freshen-0.2/examples/befriending/features/steps.py0000644000175000017500000000056511373554046021455 0ustar romanromanfrom freshen import * from friends import find_user @Transform(r'^user (\w+)$') def transform_user(username): return find_user(username) @When(r'^(user \w+) befriends (user \w+)$') def befriend(user, friend): user.befriend(friend) @Then(r'^(user \w+) should be friends with (user \w+)$') def check_friends(user, friend): assert user.is_friends_with(friend) freshen-0.2/examples/__init__.py0000644000175000017500000000000011373554046015744 0ustar romanromanfreshen-0.2/examples/docu/0000755000175000017500000000000011373554245014600 5ustar romanromanfreshen-0.2/examples/docu/__init__.py0000644000175000017500000000000011373554046016676 0ustar romanromanfreshen-0.2/examples/docu/document.py0000644000175000017500000000116011373554046016765 0ustar romanroman class Document(object): def __init__(self, num_pages): self._num_pages = num_pages self._page = 0 def set_page(self, page): if page <= self._num_pages: self._page = page def get_page(self): return self._page def get_num_pages(self): return self._num_pages def next_page(self): if self._page < self._num_pages: self._page = self._page + 1 def rip_off_page(self): if self._page == self._num_pages: self._page = self._page - 1 self._num_pages = self._num_pages - 1freshen-0.2/examples/docu/features/0000755000175000017500000000000011373554245016416 5ustar romanromanfreshen-0.2/examples/docu/features/__init__.py0000644000175000017500000000000011373554046020514 0ustar romanromanfreshen-0.2/examples/docu/features/step/0000755000175000017500000000000011373554245017371 5ustar romanromanfreshen-0.2/examples/docu/features/step/__init__.py0000644000175000017500000000000011373554046021467 0ustar romanromanfreshen-0.2/examples/docu/features/step/page_steps.py0000644000175000017500000000134411373554046022076 0ustar romanromanfrom freshen import * from freshen.checks import assert_equals from examples.docu.document import Document @Given('a document of (\d+) pages?') def create_doc(num_pages): scc.doc = Document(int(num_pages)) @Given('the page is (\d+)') def set_page_doc(page): scc.doc.set_page(int(page)) @When('I click for the next page') def click_next_page(): scc.doc.next_page() @When('I rip off the current page') def rip_off_page(): scc.doc.rip_off_page() @Then('the page is (\d+)') def check_page(expected_page): assert_equals(int(expected_page), scc.doc.get_page()) @Then('the document has (\d+) pages?') def check_num_pages(expected_num_pages): assert_equals(int(expected_num_pages), scc.doc.get_num_pages())freshen-0.2/examples/docu/features/destruction.feature0000644000175000017500000000060611373554046022337 0ustar romanromanUsing step definitions from: 'step/page_steps' Feature: Destroy a document In order to take out one's anger on a document As an unsatisfied reader I want to be able to rip off the pages of the document Scenario: Rip off a page Given a document of 5 pages And the page is 3 When I rip off the current page Then the page is 3 But the document has 4 pages freshen-0.2/examples/docu/features/navigation.feature0000644000175000017500000000052111373554046022127 0ustar romanromanUsing step definitions from: 'step/page_steps' Feature: Navigate through a document In order to read a document As a reader I want to be able to flip the pages of the document Scenario: Access next page Given a document of 5 pages And the page is 3 When I click for the next page Then the page is 4 freshen-0.2/examples/self_test/0000755000175000017500000000000011373554245015636 5ustar romanromanfreshen-0.2/examples/self_test/__init__.py0000644000175000017500000000000011373554046017734 0ustar romanromanfreshen-0.2/examples/self_test/README.textile0000644000175000017500000000034511373554046020174 0ustar romanromanh1. Self Test Cucumber's own features (ROOT_DIR/features) run the features in this directory and look at the output. Note that several of these fail intentionally. The purpose is to verify actual output against expected output.freshen-0.2/examples/self_test/features/0000755000175000017500000000000011373554245017454 5ustar romanromanfreshen-0.2/examples/self_test/features/nested_two/0000755000175000017500000000000011373554245021627 5ustar romanromanfreshen-0.2/examples/self_test/features/nested_two/__init__.py0000644000175000017500000000000011373554046023725 0ustar romanromanfreshen-0.2/examples/self_test/features/nested_two/steps/0000755000175000017500000000000011373554245022765 5ustar romanromanfreshen-0.2/examples/self_test/features/nested_two/steps/defs.py0000644000175000017500000000013311373554046024254 0ustar romanromanfrom freshen import * @Given("a step also in the nested directory") def step(): pass freshen-0.2/examples/self_test/features/nested_two/steps/__init__.py0000644000175000017500000000002411373554046025071 0ustar romanromanfrom defs import * freshen-0.2/examples/self_test/features/nested_two/nested.feature0000644000175000017500000000024611373554046024467 0ustar romanroman@nested Feature: A feature in a subdirectory (undefined) Scenario: Passing Given passing without a table And a step also in the nested directory freshen-0.2/examples/self_test/features/__init__.py0000644000175000017500000000000011373554046021552 0ustar romanromanfreshen-0.2/examples/self_test/features/failing_expectation.feature0000644000175000017500000000013411373554046025042 0ustar romanromanFeature: Failing expectation Scenario: Failing expectation Given failing expectation freshen-0.2/examples/self_test/features/sample.feature0000644000175000017500000000041011373554046022304 0ustar romanroman# Feature comment @one Feature: Sample @two @three Scenario: Missing Given missing # Scenario comment @three Scenario: Passing Given passing |a|b| |c|d| @four Scenario: Failing Given failing """ hello """ freshen-0.2/examples/self_test/features/lots_of_undefined.feature0000644000175000017500000000032411373554046024515 0ustar romanromanFeature: Lots of undefined Scenario: Implement me Given it snows in Sahara Given it's 40 degrees in Norway And it's 40 degrees in Norway When I stop procrastinating And there is world peacefreshen-0.2/examples/self_test/features/outline_sample.feature0000644000175000017500000000055211373554046024052 0ustar romanromanFeature: Outline Sample Scenario: I have no steps Scenario Outline: Test state Given without a table Given without a table Examples: Rainbow colours | state | other_state | | missing | passing| | passing| passing | | failing | passing | Examples:Only passing | state | other_state | | passing | passing |freshen-0.2/examples/self_test/features/calculator.feature0000644000175000017500000000063511373554046023165 0ustar romanromanFeature: Calculator Scenario Outline: Add two numbers Given I have entered into the calculator And I have entered into the calculator When I press