Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed detecting pending steps with 0, null or undefined values

  • Loading branch information...
commit 536c710dec6d5be2b6f7846b9d466fc69a0430b1 1 parent 60b0727
@msuarz msuarz authored
Showing with 9 additions and 6 deletions.
  1. +2 −1  src/runner/method_matcher.coffee
  2. +7 −5 src/runner/runner.coffee
View
3  src/runner/method_matcher.coffee
@@ -4,7 +4,8 @@ class @MethodMatcher
@step.args = args
@step.args.push @step.multiline_arg if @step.multiline_arg?
global.Sut = @sut
- return @sut[method]
+ @method = @sut[method]
+ true
match: (@sut, @step) -> @literal() ? @regex()
View
12 src/runner/runner.coffee
@@ -31,7 +31,7 @@ class @Runner
catch e
@fail e
- pending: -> @results.push result.pending @step, @method
+ pending: -> @results.push result.pending @step, @method()
pass: -> @results.push result.passed @step
fail: (e) -> @results.push result.failed @step, e
@@ -42,15 +42,17 @@ class @Runner
return true for sut in @suts when @matched global[sut]
false
- matched: (@sut) -> @method = @method_matcher.match @sut, @step
+ matched: (@sut) -> @method_matcher.match @sut, @step
+
+ method: -> @method_matcher.method
- is_implemented: -> _.isFunction @method
+ is_implemented: -> _.isFunction @method()
- is_async: -> @method.length is @step.args.length + 1
+ is_async: -> @method().length is @step.args.length + 1
sync_call: -> @call @step.args
async_call: (@done) -> @call @step.args.concat [@done]
- call: (args) -> @method.apply @sut, args
+ call: (args) -> @method().apply @sut, args
Please sign in to comment.
Something went wrong with that request. Please try again.