Sha256: 2932336875375a4e0b27b2c6859b90ef5fce76b4a0f326de23175021c7998ba0

Contents?: true

Size: 1.82 KB

Versions: 2

Compression:

Stored size: 1.82 KB

Contents

require_relative 'test_helper'

describe "Method Command" do
  include TestDsl

  # TODO: Need to write tests for 'method signature' command, but I can't install the 'ruby-internal' gem
  # on my machine, it fails to build gem native extension.

  describe "show instance method of a class" do
    it "must show using full command name" do
      enter 'break 15', 'cont', 'm MethodEx'
      debug_file 'method'
      check_output_includes /bla/
      check_output_doesnt_include /foo/
    end

    it "must show using shortcut" do
      enter 'break 15', 'cont', 'method MethodEx'
      debug_file 'method'
      check_output_includes /bla/
    end

    it "must show an error if specified object is not a class or module" do
      enter 'break 15', 'cont', 'm a'
      debug_file 'method'
      check_output_includes "Should be Class/Module: a"
    end
  end


  describe "show methods of an object" do
    it "must show using full command name" do
      enter 'break 15', 'cont', 'method instance a'
      debug_file 'method'
      check_output_includes /bla/
      check_output_doesnt_include /foo/
    end

    it "must show using shortcut" do
      enter 'break 15', 'cont', 'm i a'
      debug_file 'method'
      check_output_includes /bla/
    end
  end


  describe "show instance variables of an object" do
    it "must show using full name command" do
      enter 'break 15', 'cont', 'method iv a'
      debug_file 'method'
      check_output_includes '@a = "b"', '@c = "d"'
    end

    it "must show using shortcut" do
      enter 'break 15', 'cont', 'm iv a'
      debug_file 'method'
      check_output_includes '@a = "b"', '@c = "d"'
    end
  end


  describe "Post Mortem" do
    it "must work in post-mortem mode"

    0.times do
      enter 'cont', 'm i self'
      debug_file 'post_mortem'
      check_output_includes /to_s/
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
debugger2-1.0.0.beta2 test/method_test.rb
debugger2-1.0.0.beta1 test/method_test.rb