From 7e8be6bd6f6e487d3444f70f01240c542b5f8b0b Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Fri, 8 Nov 2019 00:09:44 -0600 Subject: hscript: Implement UserIcon::execute, add tests --- tests/spec/simulator_spec.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests') diff --git a/tests/spec/simulator_spec.rb b/tests/spec/simulator_spec.rb index a208be7..df2b2ae 100644 --- a/tests/spec/simulator_spec.rb +++ b/tests/spec/simulator_spec.rb @@ -344,4 +344,21 @@ printf '%s\\t%s\\t%s\\t%s\\t0\\t0\\n' /dev/gwyn/source /usr/src auto noatime >> expect(last_command_started.stdout).to include('usermod -aG ') end end + context "simulating 'usericon' execution" do + it "creates the dir if needed" do + use_fixture '0098-usericon-basic.installfile' + run_simulate + expect(last_command_started.stdout).to include("mkdir -p /target/var/lib/AccountsService/icons") + end + it "downloads remote icons" do + use_fixture '0102-usericon-protocols.installfile' + run_simulate + expect(last_command_started.stdout).to include("curl -LO /target/var/lib/AccountsService/icons/chris http://www.adelielinux.org/") + end + it "copies the correct icon" do + use_fixture '0098-usericon-basic.installfile' + run_simulate + expect(last_command_started.stdout).to include("cp /usr/share/user-manager/avatars/circles/Cat.png /target/var/lib/AccountsService/icons/awilfox") + end + end end -- cgit v1.2.3-60-g2f50