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-unbundled-2.2.19.0 vendor/bundle/ruby/3.0.0/gems/little-plugger-1.1.4/spec/little-plugger_spec.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/3.0.0/gems/little-plugger-1.1.4/spec/little-plugger_spec.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/2.7.0/gems/little-plugger-1.1.4/spec/little-plugger_spec.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/3.0.0/gems/little-plugger-1.1.4/spec/little-plugger_spec.rb
vagrant-unbundled-2.2.14.0 vendor/bundle/ruby/2.7.0/gems/little-plugger-1.1.4/spec/little-plugger_spec.rb
vagrant-unbundled-2.2.10.0 vendor/bundle/ruby/2.7.0/gems/little-plugger-1.1.4/spec/little-plugger_spec.rb
vagrant-unbundled-2.2.9.0 vendor/bundle/ruby/2.7.0/gems/little-plugger-1.1.4/spec/little-plugger_spec.rb
vagrant-unbundled-2.2.8.0 vendor/bundle/ruby/2.7.0/gems/little-plugger-1.1.4/spec/little-plugger_spec.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.7.0/gems/little-plugger-1.1.4/spec/little-plugger_spec.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/little-plugger-1.1.4/spec/little-plugger_spec.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.6.0/gems/little-plugger-1.1.4/spec/little-plugger_spec.rb
vagrant-unbundled-2.2.6.2 vendor/bundle/ruby/2.6.0/gems/little-plugger-1.1.4/spec/little-plugger_spec.rb
vagrant-unbundled-2.2.6.1 vendor/bundle/ruby/2.6.0/gems/little-plugger-1.1.4/spec/little-plugger_spec.rb
vagrant-unbundled-2.2.6.0 vendor/bundle/ruby/2.6.0/gems/little-plugger-1.1.4/spec/little-plugger_spec.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.6.0/gems/little-plugger-1.1.4/spec/little-plugger_spec.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.5.0/gems/little-plugger-1.1.4/spec/little-plugger_spec.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.5.0/gems/little-plugger-1.1.4/spec/little-plugger_spec.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.6.0/gems/little-plugger-1.1.4/spec/little-plugger_spec.rb
vagrant-unbundled-2.2.3.0 vendor/bundle/ruby/2.5.0/gems/little-plugger-1.1.4/spec/little-plugger_spec.rb
vagrant-unbundled-2.2.2.0 vendor/bundle/ruby/2.5.0/gems/little-plugger-1.1.4/spec/little-plugger_spec.rb