Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
This paste will be private.
diff --git a/mspec/runner/guards/platform.rb b/mspec/runner/guards/platform.rb index 4ea5128..515f5bc 100644 --- a/mspec/runner/guards/platform.rb +++ b/mspec/runner/guards/platform.rb @@ -39,13 +39,15 @@ end class Object def platform_is(*args) g = PlatformGuard.new(*args) - yield if g.yield? + result = g.yield? ? yield : nil g.unregister + result end def platform_is_not(*args) g = PlatformGuard.new(*args) - yield if g.yield? true + result = g.yield?(true) ? yield : nil g.unregister + result end end
From the Design Piracy series on my blog: