Sha256: 5395ebc9a6868450023e122955abd4093fc01a850be55835064baf6d0e30fad9

Contents?: true

Size: 704 Bytes

Versions: 4

Compression:

Stored size: 704 Bytes

Contents

RSpec.describe Rambo::RamlModels::Api do
  let(:raml_file) { File.join(SPEC_DIR_ROOT, "support/multiple_resources.raml") }
  let(:raml)      { Raml::Parser.parse_file(raml_file) }

  subject { described_class.new(raml) }

  describe "#resources" do
    it "has the right number of resources" do
      expect(subject.resources.count).to eql 2
    end

    it "returns an array of Resource objects" do
      all_are_resources = subject.resources.all? {|resource| resource.is_a?(Rambo::RamlModels::Resource) }
      expect(all_are_resources).to be true
    end
  end

  describe "#title" do
    it "returns the API title from the RAML doc" do
      expect(subject.title).to eql raml.title
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rambo_ruby-0.2.3 spec/lib/rambo/raml_models/api_spec.rb
rambo_ruby-0.2.2 spec/lib/rambo/raml_models/api_spec.rb
rambo_ruby-0.2.1 spec/lib/rambo/raml_models/api_spec.rb
rambo_ruby-0.2.0 spec/lib/rambo/raml_models/api_spec.rb