Sha256: 649ac8aebfc9ddba2bcddfb13d20e102728246c11abbc3093716dade78133ea6

Contents?: true

Size: 784 Bytes

Versions: 30

Compression:

Stored size: 784 Bytes

Contents

require 'helper'

describe "Pry::DefaultCommands::Documentation" do
  describe "show-doc" do
    it 'should output a method\'s documentation' do
      str_output = StringIO.new
      redirect_pry_io(InputTester.new("show-doc sample_method", "exit-all"), str_output) do
        pry
      end

      str_output.string.should =~ /sample doc/
    end

    it 'should output a method\'s documentation if inside method without needing to use method name' do
      $str_output = StringIO.new

      o = Object.new

      # sample comment
      def o.sample
        redirect_pry_io(InputTester.new("show-doc", "exit-all"), $str_output) do
          binding.pry
       end
      end
      o.sample

      $str_output.string.should =~ /sample comment/
      $str_output = nil
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
pry-0.9.4pre1 test/test_default_commands/test_documentation.rb
pry-0.9.4pre1-i386-mswin32 test/test_default_commands/test_documentation.rb
pry-0.9.4pre1-i386-mingw32 test/test_default_commands/test_documentation.rb
pry-0.9.3 test/test_default_commands/test_documentation.rb
pry-0.9.3-i386-mswin32 test/test_default_commands/test_documentation.rb
pry-0.9.3-i386-mingw32 test/test_default_commands/test_documentation.rb
pry-0.9.3pre1 test/test_default_commands/test_documentation.rb
pry-0.9.3pre1-i386-mswin32 test/test_default_commands/test_documentation.rb
pry-0.9.3pre1-i386-mingw32 test/test_default_commands/test_documentation.rb
pry-0.9.2 test/test_default_commands/test_documentation.rb
pry-0.9.2-i386-mswin32 test/test_default_commands/test_documentation.rb
pry-0.9.2-i386-mingw32 test/test_default_commands/test_documentation.rb
pry-0.9.1 test/test_default_commands/test_documentation.rb
pry-0.9.1-i386-mswin32 test/test_default_commands/test_documentation.rb
pry-0.9.1-i386-mingw32 test/test_default_commands/test_documentation.rb
pry-0.9.0 test/test_default_commands/test_documentation.rb
pry-0.9.0-i386-mswin32 test/test_default_commands/test_documentation.rb
pry-0.9.0-i386-mingw32 test/test_default_commands/test_documentation.rb
pry-0.9.0pre3 test/test_default_commands/test_documentation.rb
pry-0.9.0pre3-i386-mswin32 test/test_default_commands/test_documentation.rb