Sha256: 0ce724cb9cc466b9d72c545fc9dfe66da65a3fef8d9087686a04852bd1bf6e6c

Contents?: true

Size: 769 Bytes

Versions: 2

Compression:

Stored size: 769 Bytes

Contents

require "spec_helper"
require "parslet/rig/rspec"
require "pp"
require "benchmark"

# Uncomment to run performace specs

# describe Shortcode do

#   let(:long_text)   { load_fixture :long_text }
#   let(:parser)      { Shortcode::Parser.new }
#   let(:transformer) { Shortcode::Transformer.new }

#   context "parser" do

#     before { long_text }

#     it "runs quickly" do
#       Benchmark.realtime {
#         parser.parse long_text
#       }.should < 1.5
#     end

#   end

#   context "transformer" do

#     let(:parsed_hash) { parser.parse long_text }

#     before { parsed_hash }

#     it "runs quickly" do
#       Benchmark.realtime {
#         transformer.apply(parsed_hash, additional_attributes: nil)
#       }.should < 0.1
#     end

#   end

# end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
shortcode-2.0.0 spec/performance_spec.rb
shortcode-2.0.0.pre spec/performance_spec.rb