Sha256: 53081de28e2ead8f732c026263f3746cf57eb7ff7e7f8d5980ba85e36153609c

Contents?: true

Size: 860 Bytes

Versions: 1

Compression:

Stored size: 860 Bytes

Contents

require 'spec_helper'

describe TodoNext::Tree::Visitor::RspecGenerator do

  it 'visits the tree depth-first' do
    source = 'HEADER 1'            + "\n" +
        '  HEADER 2'          + "\n" +
        '    HEADER 3'        + "\n" +
        '      spec a'        + "\n" +
        '      spec b'        + "\n" +
        'HEADER 4'            + "\n" +
        '  spec c'            + "\n" +
        'HEADER 5'            + "\n" +
        'HEADER 6'

    expected =<<RUBY.chomp
describe "HEADER 1" do
  describe "HEADER 2" do
    describe "HEADER 3" do
      it("spec a", :pending => "spec a"){}
      it("spec b", :pending => "spec b"){}
    end
  end
end
describe "HEADER 4" do
  it("spec c", :pending => "spec c"){}
end
it("HEADER 5", :pending => "HEADER 5"){}
it("HEADER 6", :pending => "HEADER 6"){}
RUBY

    TodoNext(source).should == expected
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
todo_next-0.0.2 spec/03_rspec_generator_visitor_spec.rb