<commit_before>require 'spec_helper'

describe Padrino::Contrib::AutoLocale do
  before :all do
    mock_app {
      register Padrino::Contrib::AutoLocale

      get(:foo) { 'foo' }
    }
  end

  describe 'overloaded #url' do
    it 'prepends the default lang' do
      expect(@app.url(:foo)).to eq '/en/foo'
    end

    it 'allows overriding lang' do
      expect(@app.url(:foo, lang: 'ru')).to eq '/ru/foo'
    end
  end
end<commit_msg>padrino tests are run against 1.8.7 so we need to support it as well<commit_after>require 'spec_helper'

describe Padrino::Contrib::AutoLocale do
  before :all do
    mock_app {
      register Padrino::Contrib::AutoLocale

      get(:foo) { 'foo' }
    }
  end

  describe 'overloaded #url' do
    it 'prepends the default lang' do
      expect(@app.url(:foo)).to eq '/en/foo'
    end

    it 'allows overriding lang' do
      expect(@app.url(:foo, :lang => 'ru')).to eq '/ru/foo'
    end
  end
end
{'fraction_non_alphanumeric': 0.1279317697228145, 'fraction_numerical': 0.0031982942430703624, 'mean_word_length': 2.896265560165975, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5491147', 'n_tokens_mistral': 334, 'n_tokens_neox': 318, 'n_words': 94}