Sha256: a1ef4dd0dc575bae0febf82a20266b0a5131612ac5c9a1f0a57ead929bd80fba
Contents?: true
Size: 937 Bytes
Versions: 12
Compression:
Stored size: 937 Bytes
Contents
require 'cooperator' class ImplicitSuccess prepend Cooperator def perform $before = true $after = true end end class ExplicitSuccess prepend Cooperator def perform $before = true success! $after = true end end prepare do $before = false $after = false end subject Cooperator scope 'implicit success' do spec '.perform runs until #success! is called' do ImplicitSuccess.perform assert $before assert $after end spec '.perform returns a success context' do context = ImplicitSuccess.perform assert context, :success? refute context, :failure? end end scope 'explicit success' do spec '.perform runs until #success! is called' do ExplicitSuccess.perform assert $before refute $after end spec '.perform returns a success context' do context = ExplicitSuccess.perform assert context, :success? refute context, :failure? end end
Version data entries
12 entries across 12 versions & 1 rubygems