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"));
  6.  
  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.

Unknown's avatar

About Duncan Butler

I’m Duncan, an entrepreneur and co-founder behind nth.digital and The Puzzle Board, where I combine heritage‑focused creativity with modern technology. My work spans AI development, C# engineering, and collaborative problem‑solving with Squad, building smarter tools, streamlined workflows, and engaging digital experiences. Whether refining puzzle production systems or exploring new AI capabilities, I’m driven by creating practical, intuitive solutions that make technology feel effortless.
This entry was posted in Programming and tagged , . Bookmark the permalink.

Leave a comment