Sha256: b31aff7bb403317b3a32ad89229cd773fb75da144609b5a5d111e9d2c5d566d0

Contents?: true

Size: 958 Bytes

Versions: 2

Compression:

Stored size: 958 Bytes

Contents

require "dry/web/web_pipe/generators/inflections"

RSpec.describe Dry::Web::WebPipe::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

2 entries across 2 versions & 1 rubygems

Version Path
dry-web-web_pipe-0.2.0 spec/unit/generators/inflections_spec.rb
dry-web-web_pipe-0.1.0 spec/unit/generators/inflections_spec.rb