Sha256: da79a44ff7aba459407ac59a77d969d4b762105f43886f81bfb7a612f301f34c

Contents?: true

Size: 670 Bytes

Versions: 3

Compression:

Stored size: 670 Bytes

Contents

describe SquareBracket::Postprocess do
  include SquareBracket::Postprocess

  class ReplaceAllFoos
    def foo
      "bar"
    end

    def bar(baz)
      baz
    end
  end

  before(:each) do
    @square_bracket_post_processor = ReplaceAllFoos.new
  end

  it "does not replace methods with no matching method" do
    postprocess("[unrecognized]").should eq "[unrecognized]"
  end

  it "will replace a recognized tag" do
    postprocess("[foo]").should eq "bar"
  end

  it "passes optional parameters to the tags" do
    postprocess("[bar baz]").should eq "baz"
  end

  it "will replace multiple tags" do
    postprocess("[foo] [foo]").should eq "bar bar"
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
square_bracket-0.0.3 spec/square_bracket/postprocess_spec.rb
square_bracket-0.0.2 spec/square_bracket/postprocess_spec.rb
square_bracket-0.0.1 spec/square_bracket/postprocess_spec.rb