Sha256: 4df01b66faad082604d1fd9f340c4f14d4ffb5cd0c86a119473f9bc039e90214

Contents?: true

Size: 599 Bytes

Versions: 9

Compression:

Stored size: 599 Bytes

Contents

require 'spec_helper'

describe Analyst::Entities::Constant do

  describe "#name" do
    context "with top-level scoping" do
      let(:source) { "::Food::Pizza::Hawaiian" }

      it "correctly reports the name" do
        analyzer = Analyst.for_source(source)
        expect(analyzer.constants.first.name).to eq source
      end
    end

    context "without a scope" do
      let(:source) { "Body::Organs::Pancreas" }

      it "correctly reports the name" do
        analyzer = Analyst.for_source(source)
        expect(analyzer.constants.first.name).to eq source
      end

    end
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

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