Sha256: 3b71c5e38147b568ca68eced426e672493cdf8a68ebd21614c4835cdb85b70fb

Contents?: true

Size: 951 Bytes

Versions: 16

Compression:

Stored size: 951 Bytes

Contents

require "dry/web/roda/generators/inflections"

RSpec.describe Dry::Web::Roda::Generators::Inflections do
  subject(:inflections) { described_class }

  describe ".underscored_name" do
    it "leaves an already underscored name" do
      expect(inflections.underscored_name("my_app")).to eq "my_app"
    end

    it "leaves a name without any sort of delimiters" do
      expect(inflections.underscored_name("myapp")).to eq "myapp"
    end

    it "converts a dashed name" do
      expect(inflections.underscored_name("my-app")).to eq "my_app"
    end
  end

  describe ".camel_cased_name" do
    it "leaves an already camel cased name" do
      expect(inflections.camel_cased_name("MyApp")).to eq "MyApp"
    end

    it "converts a dashed name" do
      expect(inflections.camel_cased_name("my-app")).to eq "MyApp"
    end

    it "converts an underscored name" do
      expect(inflections.camel_cased_name("my_app")).to eq "MyApp"
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
dry-web-roda-0.13.1 spec/unit/generators/inflections_spec.rb
dry-web-roda-0.13.0 spec/unit/generators/inflections_spec.rb
dry-web-roda-0.12.0 spec/unit/generators/inflections_spec.rb
dry-web-roda-0.11.0 spec/unit/generators/inflections_spec.rb
dry-web-roda-0.10.0 spec/unit/generators/inflections_spec.rb
dry-web-roda-0.9.1 spec/unit/generators/inflections_spec.rb
dry-web-roda-0.9.0 spec/unit/generators/inflections_spec.rb
dry-web-roda-0.8.0 spec/unit/generators/inflections_spec.rb
dry-web-roda-0.7.5 spec/unit/generators/inflections_spec.rb
dry-web-roda-0.7.4 spec/unit/generators/inflections_spec.rb
dry-web-roda-0.7.3 spec/unit/generators/inflections_spec.rb
dry-web-roda-0.7.2 spec/unit/generators/inflections_spec.rb
dry-web-roda-0.7.1 spec/unit/generators/inflections_spec.rb
dry-web-roda-0.7.0 spec/unit/generators/inflections_spec.rb
dry-web-roda-0.6.3 spec/unit/generators/inflections_spec.rb
dry-web-roda-0.6.2 spec/unit/generators/inflections_spec.rb