<commit_before>require 'spec_helper'

describe Postmark::Inflector do

  describe ".to_postmark" do
    it 'converts rubyish underscored format to camel cased symbols accepted by the Postmark API' do
      subject.to_postmark(:foo_bar).should == 'FooBar'
      subject.to_postmark(:_bar).should == 'Bar'
      subject.to_postmark(:really_long_long_long_long_symbol).should == 'ReallyLongLongLongLongSymbol'
    end

    it 'accepts strings as well' do
      subject.to_postmark('foo_bar').should == 'FooBar'
    end
  end

  describe ".to_ruby" do
    it 'converts camel cased symbols returned by the Postmark API to underscored Ruby symbols' do
      subject.to_ruby('FooBar').should == :foo_bar
      subject.to_ruby('LongTimeAgoInAFarFarGalaxy').should == :long_time_ago_in_a_far_far_galaxy
      subject.to_ruby('MessageID').should == :message_id
    end
  end
end<commit_msg>Improve Postmark::Inflector's spec.<commit_after>require 'spec_helper'

describe Postmark::Inflector do

  describe ".to_postmark" do
    it 'converts rubyish underscored format to camel cased symbols accepted by the Postmark API' do
      subject.to_postmark(:foo_bar).should == 'FooBar'
      subject.to_postmark(:_bar).should == 'Bar'
      subject.to_postmark(:really_long_long_long_long_symbol).should == 'ReallyLongLongLongLongSymbol'
    end

    it 'accepts strings as well' do
      subject.to_postmark('foo_bar').should == 'FooBar'
    end

    it 'acts idempotentely' do
      subject.to_postmark('FooBar').should == 'FooBar'
    end
  end

  describe ".to_ruby" do
    it 'converts camel cased symbols returned by the Postmark API to underscored Ruby symbols' do
      subject.to_ruby('FooBar').should == :foo_bar
      subject.to_ruby('LongTimeAgoInAFarFarGalaxy').should == :long_time_ago_in_a_far_far_galaxy
      subject.to_ruby('MessageID').should == :message_id
    end
  end

end
{'fraction_non_alphanumeric': 0.09691160809371673, 'fraction_numerical': 0.0, 'mean_word_length': 4.162087912087912, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1671152', 'n_tokens_mistral': 638, 'n_tokens_neox': 598, 'n_words': 142}