Sha256: cc579410650cbec210a76ba1e3b11a59ee0eb4983d3c66b3d0f72d3dda3ec57e
Contents?: true
Size: 749 Bytes
Versions: 7
Compression:
Stored size: 749 Bytes
Contents
require 'spec_helper' describe Analyst::Entities::ConstantAssignment do let(:code) {<<-CODE class Carrier OBSTACLES = [:rain, :sleet, :snow] def deliver(mail) delivery = Delivery.new(mail) delivery.deliver! end end CODE } let(:parser) { Analyst.for_source(code) } let(:klass) { parser.classes.first } let(:constant_assignment) { klass.constant_assignments.first } describe "#name" do it "returns the short name of a constant" do expect(constant_assignment.name).to eq("OBSTACLES") end end describe "#full_name" do it "returns the full name of a constant" do expect(constant_assignment.full_name).to eq("Carrier::OBSTACLES") end end end
Version data entries
7 entries across 7 versions & 1 rubygems