lib/fix/context.rb in fix-1.0.0.beta1 vs lib/fix/context.rb in fix-1.0.0.beta2
- old
+ new
@@ -67,11 +67,11 @@
@after_hooks << block
end
def let(name, &block)
raise ::TypeError, "expected a Symbol, got #{name.class}" unless name.is_a?(::Symbol)
- raise ::NameError, "wrong method name `#{name}'" unless name.match?(/\A[a-z][a-z0-9_]+[?!]?\z/)
+ raise ::NameError, "wrong method name `#{name}'" unless name.match(/\A[a-z][a-z0-9_]+[?!]?\z/)
raise ::NameError, "reserved keyword name `#{name}'" if RESERVED_KEYWORDS.include?(name)
raise ::NameError, "reserved method name `#{name}'" if respond_to?(name, true) && !@lets.key?(name)
@lets.update(name => block.call)
rescue ::SystemExit => e
@@ -79,10 +79,10 @@
raise e
end
def let!(name, &block)
raise ::TypeError, "expected a Symbol, got #{name.class}" unless name.is_a?(::Symbol)
- raise ::NameError, "wrong method name `#{name}'" unless name.match?(/\A[a-z][a-z0-9_]+[?!]?\z/)
+ raise ::NameError, "wrong method name `#{name}'" unless name.match(/\A[a-z][a-z0-9_]+[?!]?\z/)
raise ::NameError, "reserved keyword name `#{name}'" if RESERVED_KEYWORDS.include?(name)
raise ::NameError, "reserved method name `#{name}'" if respond_to?(name, true) && !@lets.key?(name)
@lets.update(name => ::Aw.fork! { block.call })
rescue ::SystemExit => e