Sha256: f187c222f39841be089316bb55f99146c72027b9c38c9cf26bebd4e891f85c28

Contents?: true

Size: 599 Bytes

Versions: 7

Compression:

Stored size: 599 Bytes

Contents

require 'spec_helper'

describe Analyst::Entities::InstanceMethod do

  let(:code) {<<-CODE
      class DefaultCarrier
        def initialize
          @foo = "bar"
        end
      end
    CODE
  }
  let(:parser) { Analyst.for_source(code) }
  let(:klass)  { parser.classes.first }
  let(:method) { klass.imethods.first }

  describe "#name" do
    it "returns its short name" do
      expect(method.name).to eq("initialize")
    end
  end

  describe "#fulL_name" do
    it "returns its fully qualified name" do
      expect(method.full_name).to eq("DefaultCarrier#initialize")
    end
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
analyst-1.2.4 spec/entities/instance_method_spec.rb
analyst-1.2.3 spec/entities/instance_method_spec.rb
analyst-1.2.2 spec/entities/instance_method_spec.rb
analyst-1.2.1 spec/entities/instance_method_spec.rb
analyst-1.2.0 spec/entities/instance_method_spec.rb
analyst-1.0.1 spec/entities/instance_method_spec.rb
analyst-1.0.0 spec/entities/instance_method_spec.rb