package Ġru . hh . plugins . ge min io . sdk . recipe . expressions . modifiers Ċ Ċ import Ġio . kot est . core . spec . style . Free Spec Ċ import Ġio . kot est . matchers . shouldBe Ċ import Ġru . hh . plugins . ge min io . sdk . helpers . Gem inio Expression Utils Ċ import Ġru . hh . plugins . ge min io . sdk . recipe . models . expressions . Recipe Expression Modifier ĊĊ Ċ internal Ġclass ĠLayout To Activity Modifier Spec Ġ: ĠFree Spec ({ ĊĊĠĠĠ Ġfun Ġget Evalu ated Value ( activity Name : ĠString ): ĠString ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠGem inio Expression Utils . get Evalu ated Value ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠclassName Ġ= Ġactivity Name , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmodifier Ġ= ĠRecipe Expression Modifier . LAYOUT _ TO _ ACTIVITY ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĊĠĠĠ Ġ" Should Ġreturn Ġnormal Ġclass Ġname Ġwith Ġ' Activity ' Ġsuffix Ġif Ġthere Ġis Ġ' activity ' Ġword Ġin Ġlayout Ġname " Ġ{ ĊĠĠĠĠĠĠĠ Ġget Evalu ated Value (" activity _ my ") ĠshouldBe Ġ" My Activity " ĊĠĠĠĠĠĠĠ Ġget Evalu ated Value (" activity _ some ") ĠshouldBe Ġ" Some Activity " ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ" Will Ġreturn Ġ' MainActivity ' Ġfor Ġempty Ġvalue " Ġ{ ĊĠĠĠĠĠĠĠ Ġget Evalu ated Value ("") ĠshouldBe Ġ" MainActivity " ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ" Should Ġrespect Ġsingle Ġletter Ġin Ġyour Ġexpression " Ġ{ ĊĠĠĠĠĠĠĠ Ġget Evalu ated Value (" a ") ĠshouldBe Ġ" A Activity " ĊĠĠĠĠĠĠĠ Ġget Evalu ated Value (" s ") ĠshouldBe Ġ" S Activity " ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ" Only Ġfull Ġ' activity ' Ġword Ġrespect s Ġas Ġactivity Ġclass Ġname Ġsuffix Ġ( or Ġprefix )" Ġ{ ĊĠĠĠĠĠĠĠ Ġget Evalu ated Value (" ac _ ") ĠshouldBe Ġ" Ac Activity " ĊĠĠĠĠĠĠĠ Ġget Evalu ated Value (" act _ ") ĠshouldBe Ġ" Act Activity " ĊĠĠĠĠĠĠĠ Ġget Evalu ated Value (" act i _ ") ĠshouldBe Ġ" Act i Activity " ĊĠĠĠĠĠĠĠ Ġget Evalu ated Value (" activ _ ") ĠshouldBe Ġ" Activ Activity " ĊĠĠĠĠĠĠĠ Ġget Evalu ated Value (" activ i _ ") ĠshouldBe Ġ" Activ i Activity " ĊĠĠĠĠĠĠĠ Ġget Evalu ated Value (" activ it _ ") ĠshouldBe Ġ" Activ it Activity " ĊĊĠĠĠĠĠĠĠ Ġget Evalu ated Value (" ac _ some ") ĠshouldBe Ġ" Ac Some Activity " ĊĠĠĠĠĠĠĠ Ġget Evalu ated Value (" act _ some ") ĠshouldBe Ġ" Act Some Activity " ĊĠĠĠĠĠĠĠ Ġget Evalu ated Value (" act i _ some ") ĠshouldBe Ġ" Act i Some Activity " ĊĠĠĠĠĠĠĠ Ġget Evalu ated Value (" activ _ some ") ĠshouldBe Ġ" Activ Some Activity " ĊĠĠĠĠĠĠĠ Ġget Evalu ated Value (" activ i _ some ") ĠshouldBe Ġ" Activ i Some Activity " ĊĠĠĠĠĠĠĠ Ġget Evalu ated Value (" activ it _ some ") ĠshouldBe Ġ" Activ it Some Activity " ĊĠĠĠĠĠĠĠ Ġget Evalu ated Value (" activity _ some ") ĠshouldBe Ġ" Some Activity " ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ" Only Ġprefix Ġ' activity _' Ġwill Ġbe Ġtransformed Ġinto Ġdefault Ġvalue " Ġ{ ĊĠĠĠĠĠĠĠ Ġget Evalu ated Value (" activity _ ") ĠshouldBe Ġ" MainActivity " ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ" It Ġreally Ġmatters Ġwhere Ġyou Ġput Ġactivity Ġprefix " Ġ{ ĊĠĠĠĠĠĠĠ Ġget Evalu ated Value (" some _ activity ") ĠshouldBe Ġ" Some Activity Activity " ĊĠĠĠĠĠĠĠ Ġget Evalu ated Value (" activity _ normal ") ĠshouldBe Ġ" Normal Activity " ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ" Extra Ġ'_' Ġwill Ġbe Ġskipped " Ġ{ ĊĠĠĠĠĠĠĠ Ġget Evalu ated Value (" activity __ normal ") ĠshouldBe Ġ" Normal Activity " ĊĠĠĠĠĠĠĠ Ġget Evalu ated Value (" some __ activity __ good ") ĠshouldBe Ġ" Some Activity Good Activity " ĊĠĠĠ Ġ} Ċ Ċ })