Skip to content

Commit

Permalink
[BC-17787] bmt-ruby add caption and tools to items (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
fedetaglia authored Nov 24, 2021
1 parent d30b92b commit 29ad725
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
4 changes: 3 additions & 1 deletion lib/bmt/item.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
module BMT
class Item
attr_reader :key, :title, :description, :vrt_category, :step
attr_reader :key, :title, :caption, :description, :tools, :vrt_category, :step

def initialize(step:, attributes:)
@step = step
@key = attributes['key']
@title = attributes['title']
@caption = attributes['caption']
@description = attributes['description']
@tools = attributes['tools']
@vrt_category = attributes['vrt_category']
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/bmt/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Bmt
VERSION = '0.1.1'.freeze
VERSION = '0.2.0'.freeze
end
2 changes: 2 additions & 0 deletions spec/bmt/item_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
expect(subject.key).to eq('marsupial')
expect(subject.title).to be_a(String)
expect(subject.description).to be_a(String)
expect(subject.caption).to be_a(String)
expect(subject.tools).to be_a(String)
expect(subject.vrt_category).to be_a(String)
expect(subject.step).to eq(step)
end
Expand Down
12 changes: 9 additions & 3 deletions spec/sample/2.1/methodologies/outback-animal-testing.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,24 @@
{
"key": "marsupial",
"title": "Is it a marsupial?",
"description": "Marsupials are obviously mammalian and have a pouch on their underside",
"caption": "Marsupials are obviously mammalian and have a pouch on their underside",
"description": "Check for the pouch",
"tools": "Eyes",
"vrt_category": "insecure_data_storage"
},
{
"key": "diet",
"title": "Make sure it eats eucalyptus",
"description": "Almost no other animal can eat eucaluptus leaves, so this is a good diagnostic"
"caption": "Almost no other animal can eat eucaluptus leaves, so this is a good diagnostic",
"description": "Take some eucalyptus branches, remove some leaves and try to feed the alleged koala",
"tools": "Leaves and Branches"
},
{
"key": "behavior",
"title": "Does it sleep the whole day?",
"description": "Usually sleeps on trees"
"caption": "Usually sleeps on trees",
"description": "The alleged Koala should sleep the whole day if provided a tree.",
"tools": "Trees, Dawn"
}
]
},
Expand Down

0 comments on commit 29ad725

Please sign in to comment.