> class Cat
> class << self
> def start
> id = get_uuid
> begin
> yield if block_given?
> ensure
> set_some_other_state
> end
> end
> end
> #...
> end
In spite of the fact that you have an #id= method, `id =
On Thu, Oct 7, 2010 at 10:24 AM, ignacy.moryc wrote:
> I want to test a class method that sets some state and then yields a
> block. It looks something like that:
>
> class Cat
> class << self
> def start
> id = get_uuid
> begin
> yield if block_given?
>
On Thu, Oct 7, 2010 at 9:24 AM, ignacy.moryc wrote:
> I want to test a class method that sets some state and then yields a
> block. It looks something like that:
>
> class Cat
> class << self
> def start
> id = get_uuid
> begin
> yield if block_given?
>
I want to test a class method that sets some state and then yields a
block. It looks something like that:
class Cat
class << self
def start
id = get_uuid
begin
yield if block_given?
ensure
set_some_other_state
end