Tag: serverspec

Rspectesting对Docker容器失败

免责声明:我是新来ruby,RSpec等我试图find我的docker集装箱的testing框架 我有一个dockers容器,运行aws cli。 我已经testing了这个手动和它的工作,作为我的testing的一部分,我想获得AWS版本并检查它。 我已经创build了这个testing it "aws is the correct version" do expect(aws_version).to include("aws") end def aws_version command("aws –version").stdout end 当我运行它时,我得到的显示,作为空白,它看起来像没有运行,并返回任何东西 1) Dockerfile aws is the coorect version Failure/Error: expect(aws_version).to include("aws") expected "" to include "aws" # ./tests_spec.rb:37:in `block (2 levels) in <top (required)>' 我所有的其他testing正确地对容器运行。 我在下面包含了我的dockerfile和test_spec Dockerfile: FROM ubuntu:16.04 ENV LAST_UPDATE=09-04-2017 ##################################################################################### # Current version […]