dgutov / robe

Code navigation, documentation lookup and completion for Ruby
584 stars 37 forks source link

rake spec test errors #79

Closed stardiviner closed 8 years ago

stardiviner commented 8 years ago

when I run command rake spec: I got a few errors:

.F....................F.....FFF.......F................FF......................................F.F......FFF.................FF.FF

Failures:

  1) Robe::JVisor returns only modules responding to :name and :instance_methods
     Failure/Error: expect(res.all? { |m| m.respond_to? :name }).to be_true
       expected true to respond to `true?` or perhaps you meant `be true` or `be_truthy`
     # ./spec/robe/jvisor_spec.rb:16:in `block (2 levels) in <top (required)>'

  2) Robe::Sash::DocFor mentions pry-doc when relevant
     Failure/Error: expect(struct.docstring).to eq("")

       expected: ""
            got: "Cannot locate this method: gsub. Try `gem-install pry-doc` to get access to Ruby Core documentation."

       (compared using ==)
     # ./spec/robe/sash/doc_for_spec.rb:68:in `block (2 levels) in <top (required)>'

  3) Robe::Sash::DocFor native methods Know the appropriate amount about Kernel#is_a? should be empty
     Failure/Error: it { expect(struct.docstring).to be_empty }
       expected `"Returns <code>true</code> if <i>class</i> is the class of\n<i>obj</i>, or if <i>class</i> is one of the superclasses of\n<i>obj</i> or modules included in <i>obj</i>.\n\n   module M;    end\n   class A\n     include M\n   end\n   class B < A; end\n   class C < B; end\n\n   b = B.new\n   b.is_a? A          #=> true\n   b.is_a? B          #=> true\n   b.is_a? C          #=> false\n   b.is_a? M          #=> true\n\n   b.kind_of? A       #=> true\n   b.kind_of? B       #=> true\n   b.kind_of? C       #=> false\n   b.kind_of? M       #=> true".empty?` to return true, got false
     # ./spec/robe/sash/doc_for_spec.rb:108:in `block (4 levels) in <top (required)>'

  4) Robe::Sash::DocFor native methods Know the appropriate amount about Kernel#is_a? should be nil
     Failure/Error: it { expect(struct.send prop).to be_nil }

       expected: nil
            got: [:kind_of?]
     # ./spec/robe/sash/doc_for_spec.rb:110:in `block (5 levels) in <top (required)>'

  5) Robe::Sash::DocFor native methods Know the appropriate amount about Kernel#is_a? should be nil
     Failure/Error: it { expect(struct.send prop).to be_nil }

       expected: nil
            got: "VALUE\nrb_obj_is_kind_of(VALUE obj, VALUE c)\n{\n    VALUE cl = CLASS_OF(obj);\n\n    switch (TYPE(c)) {\n      case T_MODULE:\n      case T_CLASS:\n      case T_ICLASS:\n\tbreak;\n\n      default:\n\trb_raise(rb_eTypeError, \"class or module required\");\n    }\n\n    while (cl) {\n\tif (cl == c || RCLASS_M_TBL(cl) == RCLASS_M_TBL(c))\n\t    return Qtrue;\n\tcl = RCLASS_SUPER(cl);\n    }\n    return Qfalse;\n}"
     # ./spec/robe/sash/doc_for_spec.rb:110:in `block (5 levels) in <top (required)>'

  6) Robe::Sash should be true
     Failure/Error: it { expect(klass.new.ping).to be_true }
       expected "pong" to respond to `true?` or perhaps you meant `be true` or `be_truthy`
     # ./spec/robe/sash_spec.rb:367:in `block (2 levels) in <top (required)>'

  7) Robe::Sash#method_spec includes method parameters
     Failure/Error:
       expect(k.method_spec(m.instance_method(:foo)))
         .to eq([nil, true, :foo, [[:req, :a], [:rest, :b], [:block, :c]],
                 __FILE__, anything])

       expected: [nil, true, :foo, [[:req, :a], [:rest, :b], [:block, :c]], "/home/stardiviner/Code/Emacs/robe/spec/robe/sash_spec.rb", anything]
            got: [nil, true, :foo, [[:req, :a], [:rest, :b], [:block, :c]], "/home/stardiviner/Code/Emacs/robe/spec/robe/sash_spec.rb", 96]

       (compared using ==)
     # ./spec/robe/sash_spec.rb:97:in `block (3 levels) in <top (required)>'

  8) Robe::Sash#method_spec ignores overridden name method
     Failure/Error:
       expect(k.method_spec(m.instance_method(:qux)))
         .to eq(["baa", true, :qux, [], __FILE__, anything])

       expected: ["baa", true, :qux, [], "/home/stardiviner/Code/Emacs/robe/spec/robe/sash_spec.rb", anything]
            got: ["baa", true, :qux, [], "/home/stardiviner/Code/Emacs/robe/spec/robe/sash_spec.rb", 115]

       (compared using ==)
     # ./spec/robe/sash_spec.rb:119:in `block (3 levels) in <top (required)>'

  9) Robe::TypeSpace#initialize resolves simple class
     Failure/Error: expect(space.instance).to be_true
       expected true to respond to `true?` or perhaps you meant `be true` or `be_truthy`
     # ./spec/robe/type_space_spec.rb:11:in `block (3 levels) in <top (required)>'

  10) Robe::TypeSpace#initialize resolves constant to its type
      Failure/Error: expect(space.instance).to be_true
        expected true to respond to `true?` or perhaps you meant `be true` or `be_truthy`
      # ./spec/robe/type_space_spec.rb:23:in `block (3 levels) in <top (required)>'

  11) Robe::TypeSpace#scan_with module search passes class and its ancestors, then metaclass ancestors
      Failure/Error: scanner.scan(modules, instance, !instance)

        #<Double "scanner"> received :scan with unexpected arguments
          expected: (include #<Class:0x0055a43db24350> and Object, be false, true)
               got: ([#<Class:0x0055a43db24350>, Object, BasicObject, #<Class:0x0055a43dba6210>, #<Class:0x0055a43dba6198>], nil, true)
        Diff:
        @@ -1,2 +1,8 @@
        -["include #<Class:0x0055a43db24350> and Object", "be false", true]
        +[[#<Class:0x0055a43db24350>,
        +  Object,
        +  BasicObject,
        +  #<Class:0x0055a43dba6210>,
        +  #<Class:0x0055a43dba6198>],
        + nil,
        + true]
      # ./lib/robe/type_space.rb:34:in `scan_with'
      # ./spec/robe/type_space_spec.rb:94:in `block (4 levels) in <top (required)>'

  12) Robe::TypeSpace#scan_with module search passes the descendants
      Failure/Error: scanner.scan(modules, instance, !instance)

        #<Double "scanner"> received :scan with unexpected arguments
          expected: (include #<Class:0x0055a43ddb4ae8> and #<Class:0x0055a43ddb4a98>, be false, true)
               got: ([#<Class:0x0055a43ddb4c50>, Object, BasicObject, #<Class:0x0055a43ddb4ae8>, #<Class:0x0055a43ddb4a98>], nil, true)
        Diff:
        @@ -1,4 +1,8 @@
        -["include #<Class:0x0055a43ddb4ae8> and #<Class:0x0055a43ddb4a98>",
        - "be false",
        +[[#<Class:0x0055a43ddb4c50>,
        +  Object,
        +  BasicObject,
        +  #<Class:0x0055a43ddb4ae8>,
        +  #<Class:0x0055a43ddb4a98>],
        + nil,
          true]
      # ./lib/robe/type_space.rb:34:in `scan_with'
      # ./spec/robe/type_space_spec.rb:100:in `block (4 levels) in <top (required)>'

  13) Robe::TypeSpace#scan_with module search doesn't pass the included modules
      Failure/Error: expect(scanner).to receive(:scan).with(anything, be_false, true)

        (Double "scanner").scan(anything, be false, true)
            expected: 1 time with arguments: (anything, be false, true)
            received: 0 times
      # ./spec/robe/type_space_spec.rb:105:in `block (4 levels) in <top (required)>'

  14) Robe has the server running
      Failure/Error: expect(Robe.server.running).to be_true
        expected true to respond to `true?` or perhaps you meant `be true` or `be_truthy`
      # ./spec/robe_spec.rb:21:in `block (2 levels) in <top (required)>'

  15) Robe has a stop method
      Failure/Error: expect { Robe.stop }.to stop_it
        You must pass an argument rather than a block to use the provided matcher (stop it), or the matcher must implement `supports_block_expectations?`.
      # ./spec/robe_spec.rb:25:in `block (2 levels) in <top (required)>'

  16) Robe shuts down on INT
      Failure/Error: expect { Process.kill(signal, Process.pid) }.to stop_it
        You must pass an argument rather than a block to use the provided matcher (stop it), or the matcher must implement `supports_block_expectations?`.
      # ./spec/robe_spec.rb:35:in `block (3 levels) in <top (required)>'

  17) Robe shuts down on TERM
      Failure/Error: expect { Process.kill(signal, Process.pid) }.to stop_it
        You must pass an argument rather than a block to use the provided matcher (stop it), or the matcher must implement `supports_block_expectations?`.
      # ./spec/robe_spec.rb:35:in `block (3 levels) in <top (required)>'

Finished in 13.35 seconds (files took 2.83 seconds to load)
129 examples, 17 failures

Failed examples:

rspec ./spec/robe/jvisor_spec.rb:14 # Robe::JVisor returns only modules responding to :name and :instance_methods
rspec ./spec/robe/sash/doc_for_spec.rb:57 # Robe::Sash::DocFor mentions pry-doc when relevant
rspec ./spec/robe/sash/doc_for_spec.rb:108 # Robe::Sash::DocFor native methods Know the appropriate amount about Kernel#is_a? should be empty
rspec './spec/robe/sash/doc_for_spec.rb[1:8:4:3]' # Robe::Sash::DocFor native methods Know the appropriate amount about Kernel#is_a? should be nil
rspec './spec/robe/sash/doc_for_spec.rb[1:8:4:4]' # Robe::Sash::DocFor native methods Know the appropriate amount about Kernel#is_a? should be nil
rspec ./spec/robe/sash_spec.rb:367 # Robe::Sash should be true
rspec ./spec/robe/sash_spec.rb:95 # Robe::Sash#method_spec includes method parameters
rspec ./spec/robe/sash_spec.rb:102 # Robe::Sash#method_spec ignores overridden name method
rspec ./spec/robe/type_space_spec.rb:8 # Robe::TypeSpace#initialize resolves simple class
rspec ./spec/robe/type_space_spec.rb:20 # Robe::TypeSpace#initialize resolves constant to its type
rspec ./spec/robe/type_space_spec.rb:90 # Robe::TypeSpace#scan_with module search passes class and its ancestors, then metaclass ancestors
rspec ./spec/robe/type_space_spec.rb:97 # Robe::TypeSpace#scan_with module search passes the descendants
rspec ./spec/robe/type_space_spec.rb:103 # Robe::TypeSpace#scan_with module search doesn't pass the included modules
rspec ./spec/robe_spec.rb:20 # Robe has the server running
rspec ./spec/robe_spec.rb:24 # Robe has a stop method
rspec './spec/robe_spec.rb[1:5]' # Robe shuts down on INT
rspec './spec/robe_spec.rb[1:6]' # Robe shuts down on TERM

Coverage report generated for RSpec to /home/stardiviner/Code/Emacs/robe/coverage. 885 / 924 LOC (95.78%) covered.
dgutov commented 8 years ago

Run bundle exec rspec instead.

What Ruby version is this?

stardiviner commented 8 years ago

I use your command bundle exec rspec. And with ruby version 2.3.0-dev which is installed with rbenv. Here is the result output:

/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/method.rb:477: warning: respond_to? is defined here
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/wrapped_module.rb:360: warning: Pry::Method#respond_to?(:to_ary) is old fashion which takes only one parameter
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/method.rb:477: warning: respond_to? is defined here
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/wrapped_module.rb:360: warning: Pry::Method#respond_to?(:to_ary) is old fashion which takes only one parameter
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/method.rb:477: warning: respond_to? is defined here
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/wrapped_module.rb:360: warning: Pry::Method#respond_to?(:to_ary) is old fashion which takes only one parameter
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/method.rb:477: warning: respond_to? is defined here
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/wrapped_module.rb:360: warning: Pry::Method#respond_to?(:to_ary) is old fashion which takes only one parameter
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/method.rb:477: warning: respond_to? is defined here
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/wrapped_module.rb:360: warning: Pry::Method#respond_to?(:to_ary) is old fashion which takes only one parameter
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/method.rb:477: warning: respond_to? is defined here
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/wrapped_module.rb:360: warning: Pry::Method#respond_to?(:to_ary) is old fashion which takes only one parameter
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/method.rb:477: warning: respond_to? is defined here
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/wrapped_module.rb:360: warning: Pry::Method#respond_to?(:to_ary) is old fashion which takes only one parameter
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/method.rb:477: warning: respond_to? is defined here
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/wrapped_module.rb:360: warning: Pry::Method#respond_to?(:to_ary) is old fashion which takes only one parameter
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/method.rb:477: warning: respond_to? is defined here
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/wrapped_module.rb:360: warning: Pry::Method#respond_to?(:to_ary) is old fashion which takes only one parameter
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/method.rb:477: warning: respond_to? is defined here
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/wrapped_module.rb:360: warning: Pry::Method#respond_to?(:to_ary) is old fashion which takes only one parameter
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/method.rb:477: warning: respond_to? is defined here
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/wrapped_module.rb:360: warning: Pry::Method#respond_to?(:to_ary) is old fashion which takes only one parameter
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/method.rb:477: warning: respond_to? is defined here
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/wrapped_module.rb:360: warning: Pry::Method#respond_to?(:to_ary) is old fashion which takes only one parameter
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/method.rb:477: warning: respond_to? is defined here
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/wrapped_module.rb:360: warning: Pry::Method#respond_to?(:to_ary) is old fashion which takes only one parameter
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/method.rb:477: warning: respond_to? is defined here
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/wrapped_module.rb:360: warning: Pry::Method#respond_to?(:to_ary) is old fashion which takes only one parameter
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/method.rb:477: warning: respond_to? is defined here
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/wrapped_module.rb:360: warning: Pry::Method#respond_to?(:to_ary) is old fashion which takes only one parameter
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/method.rb:477: warning: respond_to? is defined here
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/wrapped_module.rb:360: warning: Pry::Method#respond_to?(:to_ary) is old fashion which takes only one parameter
/home/stardiviner/.rbenv/versions/2.3.0-dev/lib/ruby/gems/2.3.0/gems/pry-0.9.12.2/lib/pry/method.rb:477: warning: respond_to? is defined here
...................................................................................................

Pending:
  Robe::Sash::DocFor mentions pry-doc when relevant
    # https://github.com/pry/pry/issues/956
    # ./spec/robe/sash/doc_for_spec.rb:57

Finished in 24.92 seconds
129 examples, 0 failures, 1 pending
Coverage report generated for RSpec to /home/stardiviner/Code/Emacs/robe/coverage. 890 / 924 LOC (96.32%) covered.
dgutov commented 8 years ago

So, the specs pass. Any further questions here?