Sha256: 4b0c7dc3679116e8b5e5d77548ec8e074e1915d0d4453b6d576a95e64df4f1f8

Contents?: true

Size: 1.01 KB

Versions: 13

Compression:

Stored size: 1.01 KB

Contents

RSpec.describe Rambo::RSpec::Examples do
  let(:raml_file) { File.join(SPEC_DIR_ROOT, "support/foobar.raml") }
  let(:raw_raml)  { Raml::Parser.parse_file(raml_file) }
  let(:options)   { { rails: true } }
  let(:raml)      { Rambo::RamlModels::Api.new(raw_raml) }

  subject { Rambo::RSpec::Examples.new(raml, options) }

  before(:each) do
    FileUtils.mkdir_p(File.expand_path("spec/support/examples"))
  end

  after(:each) do
    FileUtils.rm_rf(File.expand_path("spec/support/examples"))
  end

  describe "#generate!" do
    it "calls render on each group" do
      expect_any_instance_of(Rambo::RSpec::ExampleGroup).to receive(:render)
      subject.generate!
    end

    it "returns an array of strings" do
      aggregate_failures do
        expect(subject.generate!).to be_a(Array)
        expect(subject.generate!.first).to be_a(String)
      end
    end
  end

  describe "#compose" do
    before(:each) { subject.generate! }

    it "returns a string" do
      expect(subject.compose).to be_a(String)
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rambo_ruby-0.7.1 spec/lib/rambo/rspec/examples_spec.rb
rambo_ruby-0.7.0 spec/lib/rambo/rspec/examples_spec.rb
rambo_ruby-0.6.0 spec/lib/rambo/rspec/examples_spec.rb
rambo_ruby-0.5.0 spec/lib/rambo/rspec/examples_spec.rb
rambo_ruby-0.4.0 spec/lib/rambo/rspec/examples_spec.rb
rambo_ruby-0.3.3 spec/lib/rambo/rspec/examples_spec.rb
rambo_ruby-0.3.2 spec/lib/rambo/rspec/examples_spec.rb
rambo_ruby-0.3.1 spec/lib/rambo/rspec/examples_spec.rb
rambo_ruby-0.3.0 spec/lib/rambo/rspec/examples_spec.rb
rambo_ruby-0.2.3 spec/lib/rambo/rspec/examples_spec.rb
rambo_ruby-0.2.2 spec/lib/rambo/rspec/examples_spec.rb
rambo_ruby-0.2.1 spec/lib/rambo/rspec/examples_spec.rb
rambo_ruby-0.2.0 spec/lib/rambo/rspec/examples_spec.rb