Sha256: b788c71cd479fceb4966c1e74aed4a78ba6ea6b333462658c90ca02832cdc824

Contents?: true

Size: 907 Bytes

Versions: 4

Compression:

Stored size: 907 Bytes

Contents

RSpec.describe Rambo::RamlModels::Method do
  let(:raml_file) { File.join(SPEC_DIR_ROOT, "support/foo.raml") }
  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

4 entries across 4 versions & 1 rubygems

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