Sha256: 6e23f2d7a8b48850242a79b3a3037ad9e2be7c9a695701d2d239fef68a8cd43e

Contents?: true

Size: 1.31 KB

Versions: 2

Compression:

Stored size: 1.31 KB

Contents

require "minitest/autorun"
require "shellwords"

describe "nem" do
  it "takes a gemspec and generates a package.json out of it" do
    assert_equal <<PACKAGE_JSON, `echo #{<<NEM_GEMSPEC.shellescape} | #{File.dirname(__FILE__)}/../bin/nem ruby gem npm`
{
  "name": "nem",
  "version": "1.0.0",
  "description": "Publish dependency free Ruby CLI gems on npm",
  "homepage": "https://github.com/janlelis/nem",
  "author": {
    "name": "Jan Lelis",
    "email": "mail@janlelis.de"
  },
  "keywords": [
    "nem",
    "ruby",
    "gem",
    "npm"
  ],
  "preferGlobal": true,
  "bin": {
    "nem": "bin/nem"
  },
  "license": "MIT"
}
PACKAGE_JSON
Gem::Specification.new do |gem|
  gem.name          = "nem"
  gem.version       = "1.0.0"
  gem.summary       = "npm + gem = nem"
  gem.description   = "Publish dependency free Ruby CLI gems on npm"
  gem.authors       = ["Jan Lelis"]
  gem.email         = ["mail@janlelis.de"]
  gem.homepage      = "https://github.com/janlelis/nem"
  gem.license       = "MIT"

  gem.files         = Dir["{**/}{.*,*}"].select{ |path| File.file?(path) && path !~ /^pkg/ }
  gem.executables   = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
  gem.test_files    = gem.files.grep(%r{^(test|spec|features)/})
  gem.require_paths = ["lib"]

  gem.required_ruby_version = "~> 2.0"
end
NEM_GEMSPEC
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nem-1.0.1 spec/nem_spec.rb
nem-1.0.0 spec/nem_spec.rb