Sha256: c595b798f0809ab909927335607728b94fa2a39fc9a913b275bb64729c1e721b

Contents?: true

Size: 908 Bytes

Versions: 10

Compression:

Stored size: 908 Bytes

Contents

require 'spec_helper'

RSpec.describe SmashingDocs::TestCase do
  let(:test_case) { SmashingDocs::TestCase.new(request, response) }

  describe "#compile_template" do
    context "with text" do
      let(:template) { "<%= 2 + 2 %>" }
      it "evaluates erb and returns a value" do
        test_case.template = template
        expect(test_case.compile_template).to eq("4")
      end
    end

    context "with a template file" do
      let!(:template) { SmashingDocs.config { |c| c.template_file = 'gem_rspec/fake_template.md.erb' } }
      it "sets the template file and returns docs matching the template" do
        test_case.template = SmashingDocs::Conf.template
        expect(test_case.compile_template).to include("use ERB")
      end
    end
  end

  describe "#created_at" do
    it "returns the time the TestCase was created" do
      expect(test_case.created_at).to be_a(Time)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
smashing_docs-1.3.6 gem_rspec/test_case_spec.rb
smashing_docs-1.3.5 gem_rspec/test_case_spec.rb
smashing_docs-1.3.4 gem_rspec/test_case_spec.rb
smashing_docs-1.3.3 gem_rspec/test_case_spec.rb
smashing_docs-1.3.2 gem_rspec/test_case_spec.rb
smashing_docs-1.3.1 gem_rspec/test_case_spec.rb
smashing_docs-1.2.1 gem_rspec/test_case_spec.rb
smashing_docs-1.2.0 gem_rspec/test_case_spec.rb
smashing_docs-1.1.0 gem_rspec/test_case_spec.rb
smashing_docs-1.0.0 gem_rspec/test_case_spec.rb