Final testing

This commit is contained in:
Judson 2017-05-15 09:36:30 -07:00
parent c39508b254
commit ae84d19e65
No known key found for this signature in database
GPG Key ID: 1817B08954BF0B7D
4 changed files with 24 additions and 10 deletions

View File

@ -5,7 +5,8 @@
}@defs:
{
pname
name
, pname ? name
, gemfile
, lockfile
, gemset
@ -77,7 +78,9 @@ let
basicEnv = buildEnv {
inherit ignoreCollisions;
name = pname;
name = if name == null then pname else name;
#name = pname;
paths = envPaths;
pathsToLink = [ "/lib" ];
@ -92,7 +95,8 @@ let
passthru = rec {
inherit ruby bundler gems mainGem confFiles; # drvName;
wrappedRuby = stdenv.mkDerivation {
wrappedRuby =
stdenv.mkDerivation {
name = "wrapped-ruby-${pname}";
nativeBuildInputs = [ makeWrapper ];
buildCommand = ''

View File

@ -27,7 +27,7 @@ let
inherit (import ./functions.nix {inherit lib ruby gemConfig groups; }) genStubsScript;
drvName =
if name != null then name
if name != null then lib.traceVal name
else if pname != null then "${toString pname}-${basicEnv.gems."${pname}".version}"
else throw "bundlerEnv: either pname or name must be set";
@ -43,7 +43,7 @@ let
if gemset == null then gemdir + "/gemset.nix"
else gemset;
basicEnv = (callPackage ./basic.nix {}) (args // { inherit pname gemdir;
basicEnv = (callPackage ./basic.nix {}) (args // { inherit pname name gemdir;
gemfile = gemfile';
lockfile = lockfile';
gemset = gemset';
@ -63,7 +63,7 @@ let
# The basicEnv should be put into passthru so that e.g. nix-shell can use it.
in
if pname == null then
basicEnv // { inherit name; }
basicEnv // { inherit name basicEnv; }
else
(buildEnv {
inherit ignoreCollisions;

View File

@ -24,11 +24,11 @@ let
functions = (import ./functions.nix testConfigs);
justName = bundlerEnv {
name = "test";
name = "test-0.1.2";
gemset = ./test/gemset.nix;
};
pnamed = basicEnv {
pnamed = bundlerEnv {
pname = "test";
gemdir = ./test;
gemset = ./test/gemset.nix;
@ -51,13 +51,13 @@ let
in
test.run "Filter excludes based on groups" gemSet (set: functions.filterGemset {inherit ruby; groups = ["a" "b"];} set == {}))
(test.run "bundlerEnv { name }" justName {
name = should.equal "test";
name = should.equal "test-0.1.2";
})
(test.run "bundlerEnv { pname }" pnamed
[
(should.haveKeys [ "name" "env" "postBuild" ])
{
name = should.equal "test";
name = should.equal "test-0.1.2";
env = should.beASet;
postBuild = should.havePrefix "/nix/store";
}

View File

@ -0,0 +1,10 @@
{
test = {
source = {
remotes = ["https://rubygems.org"];
sha256 = "1j5r0anj8m4qlf2psnldip4b8ha2bsscv11lpdgnfh4nnchzjnxw";
type = "gem";
};
version = "0.1.2";
};
}