yujinakayama/transpec

Transpec crashes on AWS.stub!

blkperl opened this issue · 2 comments

$ ruby --version
ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-linux]
$ transpec --version
3.0.7
$ cat spec/test_spec.rb

require 'aws-sdk'

AWS.stub!
$ transpec -s spec/test_spec.rb -f
Gathering the spec suite data...

Converting spec/test_spec.rb
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/transpec-3.0.7/lib/transpec/syntax/method_stub.rb:53:in `hash_arg?': undefined method `hash_type?' for nil:NilClass (NoMethodError)
    from /home/vagrant/.rvm/gems/ruby-2.1.5/gems/transpec-3.0.7/lib/transpec/converter.rb:92:in `process_method_stub'
    from /home/vagrant/.rvm/gems/ruby-2.1.5/gems/transpec-3.0.7/lib/transpec/syntax.rb:85:in `invoke_handler'
    from /home/vagrant/.rvm/gems/ruby-2.1.5/gems/transpec-3.0.7/lib/transpec/syntax.rb:69:in `dispatch_syntax'
    from /home/vagrant/.rvm/gems/ruby-2.1.5/gems/transpec-3.0.7/lib/transpec/syntax.rb:61:in `block in dispatch_node'
    from /home/vagrant/.rvm/gems/ruby-2.1.5/gems/transpec-3.0.7/lib/transpec/syntax.rb:59:in `each'
    from /home/vagrant/.rvm/gems/ruby-2.1.5/gems/transpec-3.0.7/lib/transpec/syntax.rb:59:in `find'
    from /home/vagrant/.rvm/gems/ruby-2.1.5/gems/transpec-3.0.7/lib/transpec/syntax.rb:59:in `dispatch_node'
    from /home/vagrant/.rvm/gems/ruby-2.1.5/gems/transpec-3.0.7/lib/transpec/converter.rb:42:in `block in process'
    from /home/vagrant/.rvm/gems/ruby-2.1.5/gems/astrolabe-1.3.0/lib/astrolabe/node.rb:237:in `block in visit_descendants'
    from /home/vagrant/.rvm/gems/ruby-2.1.5/gems/astrolabe-1.3.0/lib/astrolabe/node.rb:235:in `each'
    from /home/vagrant/.rvm/gems/ruby-2.1.5/gems/astrolabe-1.3.0/lib/astrolabe/node.rb:235:in `visit_descendants'
    from /home/vagrant/.rvm/gems/ruby-2.1.5/gems/astrolabe-1.3.0/lib/astrolabe/node.rb:224:in `each_node'
    from /home/vagrant/.rvm/gems/ruby-2.1.5/gems/transpec-3.0.7/lib/transpec/converter.rb:40:in `process'
    from /home/vagrant/.rvm/gems/ruby-2.1.5/gems/transpec-3.0.7/lib/transpec/base_rewriter.rb:33:in `rewrite'
    from /home/vagrant/.rvm/gems/ruby-2.1.5/gems/transpec-3.0.7/lib/transpec/base_rewriter.rb:16:in `rewrite_file!'
    from /home/vagrant/.rvm/gems/ruby-2.1.5/gems/transpec-3.0.7/lib/transpec/cli.rb:87:in `convert_spec'
    from /home/vagrant/.rvm/gems/ruby-2.1.5/gems/transpec-3.0.7/lib/transpec/cli.rb:64:in `block in process'
    from /home/vagrant/.rvm/gems/ruby-2.1.5/gems/transpec-3.0.7/lib/transpec/cli.rb:63:in `each'
    from /home/vagrant/.rvm/gems/ruby-2.1.5/gems/transpec-3.0.7/lib/transpec/cli.rb:63:in `process'
    from /home/vagrant/.rvm/gems/ruby-2.1.5/gems/transpec-3.0.7/lib/transpec/cli.rb:38:in `run'
    from /home/vagrant/.rvm/gems/ruby-2.1.5/gems/transpec-3.0.7/lib/transpec/cli.rb:19:in `run'
    from /home/vagrant/.rvm/gems/ruby-2.1.5/gems/transpec-3.0.7/bin/transpec:7:in `<top (required)>'
    from /home/vagrant/.rvm/gems/ruby-2.1.5/bin/transpec:23:in `load'
    from /home/vagrant/.rvm/gems/ruby-2.1.5/bin/transpec:23:in `<main>'
    from /home/vagrant/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `eval'
    from /home/vagrant/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `<main>'

Thanks for the report. Released 3.0.8 with the fix.

Awesome! Thanks @yujinakayama