Sha256: 93fc07ba3a002104e252146478bfb2fcc1c010545ae0b02d510029e1d8ede4e5

Contents?: true

Size: 712 Bytes

Versions: 12

Compression:

Stored size: 712 Bytes

Contents

require "spec_helper"

describe SC::Generator, 'snake_case' do

  test_hashes = [
    { :input => "FooBar", :output => "foo_bar" },
    { :input => "HeadlineCNNNews", :output => "headline_cnn_news" },
    { :input => "CNN", :output => "cnn" },
    { :input => "innerHTML", :output => "inner_html" },
    { :input => "Foo_Bar", :output => "foo_bar" },
    { :input => "Foo-Bar", :output => "foo_bar" },
    { :input => "LOGGED_IN", :output => "logged_in" },
  ]

  test_hashes.each do |test_hash|
    input = test_hash[:input]
    output = test_hash[:output]

    it "should snake_case #{input} to #{output}" do
      a = SC::Generator.new("test")

      a.snake_case(input).should eql(output)
    end
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
sproutcore-1.11.0 spec/lib/models/generator/snake_case_spec.rb
sproutcore-1.11.0.rc3 spec/lib/models/generator/snake_case_spec.rb
sproutcore-1.11.0.rc2 spec/lib/models/generator/snake_case_spec.rb
sproutcore-1.11.0.rc1 spec/lib/models/generator/snake_case_spec.rb
sproutcore-1.10.3.1 spec/lib/models/generator/snake_case_spec.rb
sproutcore-1.10.2 spec/lib/models/generator/snake_case_spec.rb
sproutcore-1.10.1 spec/lib/models/generator/snake_case_spec.rb
sproutcore-1.10.0 spec/lib/models/generator/snake_case_spec.rb
sproutcore-1.10.0.rc.3 spec/lib/models/generator/snake_case_spec.rb
sproutcore-1.10.0.rc.2 spec/lib/models/generator/snake_case_spec.rb
sproutcore-1.10.0.rc.1 spec/lib/models/generator/snake_case_spec.rb
sproutcore-1.9.2 spec/lib/models/generator/snake_case_spec.rb