Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • L ls.ext
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • digibib
  • ls.ext
  • Merge requests
  • !6

Context structs

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Benjamin requested to merge gh-16ddaeca/6/digibib/context_structs into gl-16ddaeca/6/digibib/master Jan 22, 2015
  • Overview 0
  • Commits 23
  • Pipelines 0
  • Changes 13

This patch rewrites tests to use more Object friendly code in the step definitions and @context object, using Ruby Structs (Simple classes with methods).

it is the first step towards makes scenarios demanding more than one patron possible easier to write, as the structs can have methods, and can be nested

patron = Patron.new generates also a branch and a patron category from this struct

Patron = Struct.new(:cardnumber, :surname, :branch, :category) do
  def initialize
    self.cardnumber = generateRandomString
    self.surname    = generateRandomString
    self.branch     = Branch.new
    self.category   = PatronCategory.new
  end
end

and can further trigger page objects or steps to actually generate the branch and patron category

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: gh-16ddaeca/6/digibib/context_structs