Sha256: cd8225576778fbb1690fec97ce41db0058a7963378b6ad10b6d0c18287d96a94

Contents?: true

Size: 872 Bytes

Versions: 28

Compression:

Stored size: 872 Bytes

Contents

require 'spec_helper'
require 'dpl/provider/npm'

describe DPL::Provider::NPM do
  subject :provider do
    described_class.new(DummyContext.new, :email => 'foo@blah.com', :api_key => 'test')
  end

  describe :check_auth do
    example do
      provider.should_receive(:setup_auth)
      provider.should_receive(:log).with("Authenticated with email foo@blah.com")
      provider.check_auth
    end
  end

  describe :push_app do
    example do
      provider.context.should_receive(:shell).with("npm publish")
      provider.push_app
    end
  end

  describe :setup_auth do
    example do
      f = double(:npmrc)
      File.should_receive(:open).with(File.expand_path(DPL::Provider::NPM::NPMRC_FILE)).and_return(f)
      f.should_receive(:puts).with("_auth = test")
      f.should_receive(:puts).with("email = foo@blah.com")
      provider.setup_auth
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
dpl-1.6.1.travis.447.1 spec/provider/npm.rb
dpl-1.6.0 spec/provider/npm.rb
dpl-1.5.11.travis.445.1 spec/provider/npm.rb
dpl-1.5.11.travis.437.1 spec/provider/npm.rb
dpl-1.5.11.travis.436.1 spec/provider/npm.rb
dpl-1.5.11.travis.435.1 spec/provider/npm.rb
dpl-1.5.11.travis.432.1 spec/provider/npm.rb
dpl-1.5.11.travis.430.1 spec/provider/npm.rb
dpl-1.5.11.travis.414.1 spec/provider/npm.rb
dpl-1.5.10 spec/provider/npm.rb
dpl-1.5.10.travis.413.1 spec/provider/npm.rb
dpl-1.5.10.travis.402.1 spec/provider/npm.rb
dpl-1.6.0.travis.399.1 spec/provider/npm.rb
dpl-1.5.9 spec/provider/npm.rb
dpl-1.5.9.travis.397.1 spec/provider/npm.rb
dpl-1.5.9.travis.394.1 spec/provider/npm.rb
dpl-1.5.9.travis.393.1 spec/provider/npm.rb
dpl-1.5.9.travis.390.1 spec/provider/npm.rb
dpl-1.5.9.travis.373.1 spec/provider/npm.rb
dpl-1.5.9.travis.372.1 spec/provider/npm.rb