Sha256: 9a0c63171d33d0fcd8fce83456ba31e8c4016f523fdb58d4a4798ece6357ab88

Contents?: true

Size: 1.05 KB

Versions: 47

Compression:

Stored size: 1.05 KB

Contents

require File.join(File.dirname(__FILE__), %w[spec_helper])

describe LittlePlugger do

  it "converts a string from camel-case to underscore" do
    expect(LittlePlugger.underscore('FooBarBaz')).to eq('foo_bar_baz')
    expect(LittlePlugger.underscore('CouchDB')).to eq('couch_db')
    expect(LittlePlugger.underscore('FOOBar')).to eq('foo_bar')
    expect(LittlePlugger.underscore('Foo::Bar::BazBuz')).to eq('foo/bar/baz_buz')
  end

  it "generates a default plugin path" do
    expect(LittlePlugger.default_plugin_path(LittlePlugger)).to eq('little_plugger/plugins')
    expect(LittlePlugger.default_plugin_path(Process::Status)).to eq('process/status/plugins')
  end

  it "generates a default plugin module" do
    expect(LittlePlugger.default_plugin_module('little_plugger')).to eq(LittlePlugger)
    expect {LittlePlugger.default_plugin_module('little_plugger/plugins')}.to \
        raise_error(NameError, /uninitialized constant (LittlePlugger::)?Plugins/)
    expect(LittlePlugger.default_plugin_module('process/status')).to eq(Process::Status)
  end
end

# EOF

Version data entries

47 entries across 39 versions & 4 rubygems

Version Path
vagrant-compose-yaml-0.1.0 vendor/bundle/ruby/2.2.0/gems/little-plugger-1.1.4/spec/little-plugger_spec.rb
vagrant-unbundled-1.8.5.2 vendor/bundle/ruby/2.3.0/gems/little-plugger-1.1.4/spec/little-plugger_spec.rb
vagrant-unbundled-1.8.5.1 vendor/bundle/ruby/2.3.0/gems/little-plugger-1.1.4/spec/little-plugger_spec.rb
vagrant-unbundled-1.8.4.2 vendor/bundle/ruby/2.3.0/gems/little-plugger-1.1.4/spec/little-plugger_spec.rb
vagrant-unbundled-1.8.4.1 vendor/bundle/ruby/2.3.0/gems/little-plugger-1.1.4/spec/little-plugger_spec.rb
vagrant-unbundled-1.8.1.1 vendor/bundle/ruby/2.3.0/gems/little-plugger-1.1.4/spec/little-plugger_spec.rb
little-plugger-1.1.4 spec/little-plugger_spec.rb