저는이 모든 것을 완전히 새롭게했습니다. 비커를 사용하여 꼭두각시 모듈을 테스트하려고합니다. 나는이 점점 계속 :정의되지 않은 지역 변수 또는 메서드 - 비커를 사용하여 퍼펫 모듈 테스터
NoMethodError: undefined method `describe' for
#Beaker::TestCase:0x007fd6f95e6460
/Users/user1/beaker/Puppet/puppet-files/spec/classes/unit_spec.rb:3
/Users/user1/.rvm/gems/ruby-2.2.7/gems/beaker-3.24.0/bin/beaker:9
/Users/user1/.rvm/gems/ruby-2.2.7/bin/ruby_executable_hooks:15
/Users/user1/.rvm/gems/ruby-2.2.7/bin/ruby_executable_hooks:15.
This is the command that I'm running - "beaker --hosts myhost.yaml --pre-suite spec".
내 unit_spec.rb이 포함
require 'puppetlabs_spec_helper/rake_tasks'
describe 'application' do
context 'applied to supported operating system' do
on_supported_os.each do |os, facts|
context "#{os}" do
let(:facts) do
facts
end
context "without any parameters" do
let(:params) {{ }}
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_class('files') }
end
end
end
end
context 'applied to unsupported operating system' do
describe 'ubuntu-14-x86_64' do
let(:facts) {{
:osfamily => 'Debian',
:operatingsystem => 'Ubuntu'
}}
it { is_expected.to raise_error(Puppet::Error, /Ubuntu not supported/) }
end
end
end
어떤 도움이 많이 주시면 감사하겠습니다! Btw, 난 'puppetlabs_spec_helper/rake_tasks'를 사용하고 있는데, 사실 'spec_helper'를 사용했을 때 거기에 있었지만 "파일을로드 할 수 없다"는 오류가 나왔습니다.
또한, 나도 문제가 해결되지 않은
RSpec.Describe
을하고 노력했다. 나는 다음과 같은 오류 얻을 -하지만 지금은 어떻게 비커 꽤 확실하지를 사용하여 테스트하기 위해 노력하고, 내가이 모듈은 이전에 꼭두각시 RSpec을 통해 테스트되면서이, RSpec에 인형의 문제가 될 수 있음을 깨닫게
NameError: undefined local variable or method `on_supported_os' for #Class:0x007f92a61d5e58
을 완전히 그것을 달성하십시오!
'require'rspec '을 (를) 추가하십시오. –
나는 그것을 아직도 시도하고있다. - NameError : 정의되지 않은 지역 변수 또는 메소드 "on_supported_os"for #Class : 0x007f92a61d5e58' –
여기서'on_supported_os'가 정의되어 있습니까 ?? 위의 코드에서 우리를 표시하지 않았습니다. –