Sha256: af835ed0307371d5f00ba748e7965de017fbb85798d0d93f0ac1df6a075b62a1

Contents?: true

Size: 918 Bytes

Versions: 1

Compression:

Stored size: 918 Bytes

Contents

RSpec.describe Rambo::RamlModels::Method do
  let(:raml_file) { File.expand_path("../../../support/foo.raml", __FILE__) }
  let(:raml) { Raml::Parser.parse_file(raml_file) }
  let(:method) { raml.resources.first.methods.first }

  subject { described_class.new(method) }

  describe "#to_s" do
    it "returns the method name" do
      expect(subject.method).to eql method.method
    end
  end

  describe "#description" do
    it "returns the description" do
      expect(subject.description).to eql method.description
    end
  end

  describe "#request_body" do
    it "returns a request body" do
      expect(subject.request_body).to be_a Rambo::RamlModels::Body
    end
  end

  describe "#responses" do
    it "returns an array of Response objects" do
      all_are_responses = subject.responses.all? {|resp| resp.is_a?(Rambo::RamlModels::Response) }
      expect(all_are_responses).to be true
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rambo_ruby-0.1.0 spec/lib/raml_models/method_spec.rb