SpecSalad update

I have updated SpecSalad with a new feature today, ApplicationRoles is now a base class which all roles must inherit from, this base class contains the functionality to save and retrieve values.  This will allow a task to store important values within the scenario context for later use, using the traditional key value pair.

So a feature

Scenario: Save a value
    Given I am a specified role
    When I attempt to store: the value '3'
    Then I should retrieve the answer '3'

Can call a task, telling the role to store a value

  1. public class Store : ApplicationTask
  2. {
  3.     public override object Perform_Task()
  4.     {
  5.         Role.StoreValue("the_value", Details.Value_Of("the_value"));
  7.         return null;
  8.     }
  9. }

and later in the scenario retrieve the value, in this case returning it to do the scenario assert.

  1. public class RetrieveTheAnswer : ApplicationTask
  2. {
  3.     public override object Perform_Task()
  4.     {
  5.         return Role.Retrieve("the_value");
  6.     }
  7. }

I have also added a new feature to show the use of the background: scenario step, and updated the readme file.

These updates are available in SpecSalad version 1.2 on the Nuget gallery.


About Duncan Butler

Trying to be a very agile software developer, working in C# with Specflow, Nunit and Machine Specifications, and in the evening having fun with Ruby and Rails
This entry was posted in Programming and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s