Sha256: 583bb425e021592f5a2cd8b64d6aa65d7409e28d535a366a39409fe0440b7414

Contents?: true

Size: 832 Bytes

Versions: 2

Compression:

Stored size: 832 Bytes

Contents

require 'spec_helper'

describe "Parser" do

  let(:parser) { Analyst.for_file("./spec/fixtures/music.rb") }

  describe "#top_level_classes" do

    it "lists top-level classes" do
      class_names = parser.top_level_classes.map(&:full_name)
      expect(class_names).to match_array ["Artist", "Singer", "Song"]
    end

  end

  describe "#classes" do
    it "lists all classes from recursive search" do
      all_classes = %w[Artist Singer Song
                       Instruments::Stringed Instruments::Guitar
                       Performances::Equipment::Amp
                       Performances::Equipment::Microphone
                       Performances::Equipment::MicStand
                     ]

      class_names = parser.classes.map(&:full_name)

      expect(class_names).to match_array all_classes
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
analyst-1.0.1 spec/parser_spec.rb
analyst-1.0.0 spec/parser_spec.rb