Re: [Pharo-users] memorizing data between tests

2018-09-09 Thread Esteban Maringolo
You can use a TestResource for it, and use some sort of memoization.

I don't know if there is a library for memoization in Pharo, but if
the HTTP calls are not that many you can implement it by having a
cache in the test resource, implemented as a dictionary, with the URL
as key and its cached response as value.

Regards,

Esteban A. Maringolo

El dom., 9 sept. 2018 a las 5:11, Peter Uhnak () escribió:
>
> Hi Ben,
>
> take a look at TestResource (its comment and subclasses). It should do what 
> you are looking for.
>
> Peter
>
> On Sun, Sep 9, 2018 at 8:08 AM Ben Coman  wrote:
>>
>> Say I want to write ten tests for different aspects of a web service point.
>> Apart from the risk of relying on an external service,
>> I'd like to poll the web service once rather than ten times.
>> I wondering about the feasibility of memorizing data between test methods.
>> Taking for example...
>>  TestCase subclass: #MyTest ...
>>
>> My understanding is that MyTest >> setUp is run once per test method.
>> What I guess is missing is a #groupSetup that would be called at the start 
>> of a running a group of tests.
>>
>> MyTest >> groupSetup
>> memorized := Dictionary new.
>>
>> MyTest >> getLiveDataOncePerRun
>> ^ memorized at: 'data' ifAbsentPut: [ZnClient new get: 
>> 'http://someservice.com/liveData1'.
>>
>> MyTest >> test1
>> |data|
>> data  := self  getLiveDataOncePerRun  .
>> self assert: data result1 equals: 'expected result 1'
>>
>> MyTest >> test2
>> |data|
>> data  := self  getLiveDataOncePerRun.
>> self assert: data result2 equals: 'expected result 2'
>>
>> cheers -ben
>>



Re: [Pharo-users] Ready to use Roassal?

2018-09-09 Thread Hilaire
Le 09/09/2018 à 15:06, Peter Uhnak a écrit :
> Not sure if this is already fixed in P7, but in P6 sometimes the
> catalog would not load properly... so one has to close pharo and open
> it again... probably not the best experience for non-pharo user.

This was my taught too.

>
> Also, if your user is using linux, they also need to have
> libcairo(i386) installed, otherwise Roassal will not work.
This one is ok, this is a Dr. Geo user.

Hilaire

-- 
Dr. Geo
http://drgeo.eu





Re: [Pharo-users] Ready to use Roassal?

2018-09-09 Thread Peter Uhnak
Not sure if this is already fixed in P7, but in P6 sometimes the catalog
would not load properly... so one has to close pharo and open it again...
probably not the best experience for non-pharo user.

Also, if your user is using linux, they also need to have libcairo(i386)
installed, otherwise Roassal will not work.

Peter

On Sun, Sep 9, 2018 at 2:16 PM Hilaire  wrote:

> Hello Alexandre,
>
> Afterward, I have indicated that to this non-pharo user.
>
>
> Le 09/09/2018 à 11:36, Alexandre Bergel via Pharo-users a écrit :
> > The agilevisualization.com website says:
> >
> > "Installing Roassal is easy. You need to install Pharo. Open the Catalog
> browser, and select Roassal. A video illustrating these steps is online.”
> >
> > How can I improve the installation instruction?
> >
> > Also, the Quickstart chapter details the steps:
> >
> http://agilevisualization.com/AgileVisualization/QuickStart/0101-QuickStart.html
> I was confused as I did not find this zip file ready to download, as
> described in this quick start page.
>
> Hilaire
>
> --
> Dr. Geo
> http://drgeo.eu
>
>
>
>


Re: [Pharo-users] [Pharo-dev] Pharo and Docker (some steps)

2018-09-09 Thread Pierce Ng
On Mon, Aug 20, 2018 at 03:10:58PM +0200, Torsten Bergmann wrote:
> I recently played with Pharo and Docker and summarized some of my
> steps in a small tutorial in my Pharo wiki:

Monkey saw, and monkey did. :-) Here's my report on my experimentation:

  http://www.samadhiweb.com/blog/2018.09.09.docker.html

Pierce



Re: [Pharo-users] Ready to use Roassal?

2018-09-09 Thread Hilaire
Hello Alexandre,

Afterward, I have indicated that to this non-pharo user.


Le 09/09/2018 à 11:36, Alexandre Bergel via Pharo-users a écrit :
> The agilevisualization.com website says:
>
> "Installing Roassal is easy. You need to install Pharo. Open the Catalog 
> browser, and select Roassal. A video illustrating these steps is online.”
>
> How can I improve the installation instruction?
>
> Also, the Quickstart chapter details the steps:
> http://agilevisualization.com/AgileVisualization/QuickStart/0101-QuickStart.html
I was confused as I did not find this zip file ready to download, as
described in this quick start page.

Hilaire

-- 
Dr. Geo
http://drgeo.eu





Re: [Pharo-users] Ready to use Roassal?

2018-09-09 Thread Alexandre Bergel via Pharo-users
--- Begin Message ---
Hi Hilaire,

> Is there a ready to download and to use Roassal for end user?

I am not sure what you mean. For non-pharo user?

> I found nothing on http://agilevisualization.com/ I can point a user to.
> User unaware of Pharo, Smalltalk, etc.

The agilevisualization.com website says:

"Installing Roassal is easy. You need to install Pharo. Open the Catalog 
browser, and select Roassal. A video illustrating these steps is online.”

How can I improve the installation instruction?

Also, the Quickstart chapter details the steps:
http://agilevisualization.com/AgileVisualization/QuickStart/0101-QuickStart.html

Cheers,
Alexandre
--- End Message ---


Re: [Pharo-users] memorizing data between tests

2018-09-09 Thread Ben Coman
That seems to be exactly what I'm looking for. Thanks Peter.
cheers -ben

On Sun, 9 Sep 2018 at 16:11, Peter Uhnak  wrote:

> Hi Ben,
>
> take a look at TestResource (its comment and subclasses). It should do
> what you are looking for.
>
> Peter
>
> On Sun, Sep 9, 2018 at 8:08 AM Ben Coman  wrote:
>
>> Say I want to write ten tests for different aspects of a web service
>> point.
>> Apart from the risk of relying on an external service,
>> I'd like to poll the web service once rather than ten times.
>> I wondering about the feasibility of memorizing data between test methods.
>> Taking for example...
>>  TestCase subclass: #MyTest ...
>>
>> My understanding is that MyTest >> setUp is run once per test method.
>> What I guess is missing is a #groupSetup that would be called at the
>> start of a running a group of tests.
>>
>> MyTest >> groupSetup
>> memorized := Dictionary new.
>>
>> MyTest >> getLiveDataOncePerRun
>> ^ memorized at: 'data' ifAbsentPut: [ZnClient new get: '
>> http://someservice.com/liveData1'.
>>
>> MyTest >> test1
>> |data|
>> data  := self  getLiveDataOncePerRun  .
>> self assert: data result1 equals: 'expected result 1'
>>
>> MyTest >> test2
>> |data|
>> data  := self  getLiveDataOncePerRun.
>> self assert: data result2 equals: 'expected result 2'
>>
>> cheers -ben
>>
>>


Re: [Pharo-users] memorizing data between tests

2018-09-09 Thread Peter Uhnak
Hi Ben,

take a look at TestResource (its comment and subclasses). It should do what
you are looking for.

Peter

On Sun, Sep 9, 2018 at 8:08 AM Ben Coman  wrote:

> Say I want to write ten tests for different aspects of a web service point.
> Apart from the risk of relying on an external service,
> I'd like to poll the web service once rather than ten times.
> I wondering about the feasibility of memorizing data between test methods.
> Taking for example...
>  TestCase subclass: #MyTest ...
>
> My understanding is that MyTest >> setUp is run once per test method.
> What I guess is missing is a #groupSetup that would be called at the start
> of a running a group of tests.
>
> MyTest >> groupSetup
> memorized := Dictionary new.
>
> MyTest >> getLiveDataOncePerRun
> ^ memorized at: 'data' ifAbsentPut: [ZnClient new get: '
> http://someservice.com/liveData1'.
>
> MyTest >> test1
> |data|
> data  := self  getLiveDataOncePerRun  .
> self assert: data result1 equals: 'expected result 1'
>
> MyTest >> test2
> |data|
> data  := self  getLiveDataOncePerRun.
> self assert: data result2 equals: 'expected result 2'
>
> cheers -ben
>
>


[Pharo-users] memorizing data between tests

2018-09-09 Thread Ben Coman
Say I want to write ten tests for different aspects of a web service point.
Apart from the risk of relying on an external service,
I'd like to poll the web service once rather than ten times.
I wondering about the feasibility of memorizing data between test methods.
Taking for example...
 TestCase subclass: #MyTest ...

My understanding is that MyTest >> setUp is run once per test method.
What I guess is missing is a #groupSetup that would be called at the start
of a running a group of tests.

MyTest >> groupSetup
memorized := Dictionary new.

MyTest >> getLiveDataOncePerRun
^ memorized at: 'data' ifAbsentPut: [ZnClient new get: '
http://someservice.com/liveData1'.

MyTest >> test1
|data|
data  := self  getLiveDataOncePerRun  .
self assert: data result1 equals: 'expected result 1'

MyTest >> test2
|data|
data  := self  getLiveDataOncePerRun.
self assert: data result2 equals: 'expected result 2'

cheers -ben