Sha256: 4c2173a6510420572d20fbb79fe30338b01f959c82e0d047ad3c921211ee939b

Contents?: true

Size: 521 Bytes

Versions: 3

Compression:

Stored size: 521 Bytes

Contents

require 'test_helper'

class Fastly
  class FooBar; end
  class FooBarBaz; end
  describe Util do
    describe '.class_to_path' do
      let(:klass)        { Fastly::FooBar }
      let(:klass_with_s) { Fastly::FooBarBaz }

      it 'should convert a class name to an underscored path' do
        assert_equal 'foo_bar', Util.class_to_path(klass)
      end

      it 'should append an s if second argument is true' do
        assert_equal 'foo_bar_bazs', Util.class_to_path(klass_with_s, true)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fastly-1.1.4 test/fastly/util_test.rb
fastly-1.1.3 test/fastly/util_test.rb
fastly-1.1.2 test/fastly/util_test.rb