How to pick the particular data from the spock table

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to pick the particular data from the spock table

Rajesh Moorthy
Hi,

I have to Store multiple data's in the spock table . Whenever required i have to pass the data through parameter value, according to that it should search in the spock table, pick corresponding data. Please see the code and correct it or let me know hwo to handle it.. It would be very much helpful to me to implement my project.

def passW = "Publisher"
 def "getPassword" (passW) {

expect:

     if (secureKeyword == passW ) {

        println "Result is " + encryptPass
       }

     where:
     secureKeyword || encryptPass
     "Author"      || "aW50ZWxAMTIzNCE="
     "Publisher"   || "tsdwerDhV76wYCf="
 }

Result should be : tsdwerDhV76wYCf=

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to pick the particular data from the spock table

Kostis Kapelonis
Hello

It seems that you have asked this question multiple times already.
Please read what people are saying to you.

http://stackoverflow.com/questions/39888135/how-to-pick-the-particular-row-value-from-spock-table
http://stackoverflow.com/questions/39763657/how-can-i-search-and-return-the-values-and-pass-it-to-the-method-from-spock-tabl

In summary, the tables in Spock are used for unit tests, and not as a
general storage medium that you "pick" values from.

Kostis

On Mon, Oct 10, 2016 at 8:12 PM, Rajesh Moorthy
<[hidden email]> wrote:

> Hi,
>
> I have to Store multiple data's in the spock table . Whenever required i
> have to pass the data through parameter value, according to that it should
> search in the spock table, pick corresponding data. Please see the code and
> correct it or let me know hwo to handle it.. It would be very much helpful
> to me to implement my project.
>
> def passW = "Publisher"
>  def "getPassword" (passW) {
>
> expect:
>
>      if (secureKeyword == passW ) {
>
>         println "Result is " + encryptPass
>        }
>
>      where:
>      secureKeyword || encryptPass
>      "Author"      || "aW50ZWxAMTIzNCE="
>      "Publisher"   || "tsdwerDhV76wYCf="
>  }
>
> Result should be : tsdwerDhV76wYCf=
>
> --
> You received this message because you are subscribed to the Google Groups
> "Spock Framework - User" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
> To post to this group, send email to [hidden email].
> Visit this group at https://groups.google.com/group/spockframework.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.