2017-05-28 00:19:34 +02:00
|
|
|
{ stdenv, writeText, lib, ruby, defaultGemConfig, callPackage, test, stubs, should}@defs:
|
2017-05-01 18:07:42 +02:00
|
|
|
let
|
2017-05-09 18:39:20 +02:00
|
|
|
bundlerEnv = callPackage ./default.nix stubs // {
|
2017-05-28 00:19:34 +02:00
|
|
|
basicEnv = callPackage ../bundled-common stubs;
|
2017-05-01 18:07:42 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
justName = bundlerEnv {
|
2017-05-15 18:36:30 +02:00
|
|
|
name = "test-0.1.2";
|
2017-05-01 18:07:42 +02:00
|
|
|
gemset = ./test/gemset.nix;
|
|
|
|
};
|
|
|
|
|
2017-05-15 18:36:30 +02:00
|
|
|
pnamed = bundlerEnv {
|
2017-05-01 18:07:42 +02:00
|
|
|
pname = "test";
|
2017-05-04 05:27:42 +02:00
|
|
|
gemdir = ./test;
|
2017-05-01 18:07:42 +02:00
|
|
|
gemset = ./test/gemset.nix;
|
2017-05-04 05:27:42 +02:00
|
|
|
gemfile = ./test/Gemfile;
|
|
|
|
lockfile = ./test/Gemfile.lock;
|
2017-05-01 18:07:42 +02:00
|
|
|
};
|
2017-05-28 00:19:34 +02:00
|
|
|
in
|
|
|
|
builtins.concatLists [
|
2017-05-01 18:07:42 +02:00
|
|
|
(test.run "bundlerEnv { name }" justName {
|
2017-05-15 18:36:30 +02:00
|
|
|
name = should.equal "test-0.1.2";
|
2017-05-01 18:07:42 +02:00
|
|
|
})
|
|
|
|
(test.run "bundlerEnv { pname }" pnamed
|
2017-05-04 05:27:42 +02:00
|
|
|
[
|
|
|
|
(should.haveKeys [ "name" "env" "postBuild" ])
|
|
|
|
{
|
2017-05-15 18:36:30 +02:00
|
|
|
name = should.equal "test-0.1.2";
|
2017-05-04 05:27:42 +02:00
|
|
|
env = should.beASet;
|
2017-05-09 18:39:20 +02:00
|
|
|
postBuild = should.havePrefix "/nix/store";
|
2017-05-04 05:27:42 +02:00
|
|
|
}
|
|
|
|
])
|
2017-05-28 00:19:34 +02:00
|
|
|
]
|