# Features A Plain Text User Stories Parser that supports native Programming Languages. ## Usage ### Ruby on Rails 1. Install features: $ gem install features 2. Generate the supporting folders from your rails apps root folder: $ script/generate features 3. Run the HelloWorld.feature: * (OS X): There is a `run_features.rb` script that will open its results in Safari: $ ruby test/features/run_features.rb * (Other OS): INSTRUCTIONS WILL FOLLOW SOON ... 4. Here is what the Html Output looks like: ### Objective-C 1. Install features: $ sudo gem install 2. Download and install ObjectiveMatchy 3. ObjectiveMatchy provides Xcode Project Templates that have a Feature Target. Create a new Xcode Project and choose one of the ObjectiveMatchy Templates. 4. ... ### More Languages will follow ... ## How it works ### Features parses plain-text user story files That files are made up of keywords (Feature:, Scenario:) and step definitions (When I say 'Hello, World!'): Feature: Hello World Scenario: Say Hello World When I say 'Hello, World!' ### Next, a TestCase File will be generated Each Feature (User Story) will be generated as a TestCase. Each Scenario as a test method. The step definitions provide the test method implementations. Regarding the above Feature, here is what the autogenerated testcases will look like in the different languages: * Rails: require "/path/to/project/support/features_helper.rb" class HelloWorldTest < FeaturesTestCaseClass def test_SayHelloWorld when_I_say___("Hello, World!") end end * Objective C: #import "OMFeature.h" @interface HelloWorldTest : OMFeature @end @implementation HelloWorldTest -(void) testSayHelloWorld { [self When_I_say___:@"Hello, World!"]; } @end * Other Languages (Java, C#, C++, Python) will follow soon ... ### Provide Step Implementations Steps are instance method of the intermediate TestCase class (eg 'FeaturesTestCaseClass' in Rails) that inherits from the language specific TestCase class (eg 'ActionController::IntegrationTest' in Rails) and that itself is the parent of the generated TestCases. This way, all test method implementations (aka Scenarios) will have access to the steps. ## Installation gem install features ## Contribution * Idea?, Feature Request?, Bug? -> [Lighthouse](http://300.lighthouseapp.com/projects/36609-features/overview) * source -> [GitHub](http://github.com/mhennemeyer/features) * talk? -> [GoogleGroup](http://groups.google.de/group/featuresgroup) ## Licence (The MIT License) Copyright (c) Matthias Hennemeyer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.