Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, ruby, defaultGemConfig, test, should }: 2let 3 testConfigs = { 4 inherit lib; 5 gemConfig = defaultGemConfig; 6 }; 7 functions = (import ./functions.nix testConfigs); 8in 9 builtins.concatLists [ 10 ( test.run "All set, no gemdir" (functions.bundlerFiles { 11 gemfile = test/Gemfile; 12 lockfile = test/Gemfile.lock; 13 gemset = test/gemset.nix; 14 }) { 15 gemfile = should.equal test/Gemfile; 16 lockfile = should.equal test/Gemfile.lock; 17 gemset = should.equal test/gemset.nix; 18 }) 19 20 ( test.run "Just gemdir" (functions.bundlerFiles { 21 gemdir = test/.; 22 }) { 23 gemfile = should.equal test/Gemfile; 24 lockfile = should.equal test/Gemfile.lock; 25 gemset = should.equal test/gemset.nix; 26 }) 27 28 ( test.run "Gemset and dir" (functions.bundlerFiles { 29 gemdir = test/.; 30 gemset = test/extraGemset.nix; 31 }) { 32 gemfile = should.equal test/Gemfile; 33 lockfile = should.equal test/Gemfile.lock; 34 gemset = should.equal test/extraGemset.nix; 35 }) 36 37 ( test.run "Filter empty gemset" {} (set: functions.filterGemset {inherit ruby; groups = ["default"]; } set == {})) 38 ( let gemSet = { test = { groups = ["x" "y"]; }; }; 39 in 40 test.run "Filter matches a group" gemSet (set: functions.filterGemset {inherit ruby; groups = ["y" "z"];} set == gemSet)) 41 ( let gemSet = { test = { platforms = []; }; }; 42 in 43 test.run "Filter matches empty platforms list" gemSet (set: functions.filterGemset {inherit ruby; groups = [];} set == gemSet)) 44 ( let gemSet = { test = { platforms = [{engine = ruby.rubyEngine; version = ruby.version.majMin;}]; }; }; 45 in 46 test.run "Filter matches on platform" gemSet (set: functions.filterGemset {inherit ruby; groups = [];} set == gemSet)) 47 ( let gemSet = { test = { groups = ["x" "y"]; }; }; 48 in 49 test.run "Filter excludes based on groups" gemSet (set: functions.filterGemset {inherit ruby; groups = ["a" "b"];} set == {})) 50 ]