我以前根本没有红宝石的经验。我对ruby (因此不了解rails等)并不感兴趣,但我正在使用傀儡来管理一组服务器。我已经编写了一些模块,rspec-傀儡系统看起来会非常有用。
然而,我不能让rspec-傀儡工作。
我正在使用Ubuntu 10.04
我已经安装了木偶rspec,使用他们的网页上的说明。
我实际上做了什么
apt-get install rubygems # (installs 1.8)
gem install rspec-expectations
gem install rspec-puppet我还安装了图书规范-ruby1.8
然后,我在我已经创建的木偶模块目录中运行了rspec-傀儡-init(这是一个工作的傀儡模块)
我按照教程中的定义创建了一个文件
$ more spec/defines/rule_spec.rb
require 'spec_helper'
describe 'vanusers::rule' do
let(:title) { 't1' }
it { should contain_class('vanusers::JamieA') }
end但是当我尝试运行它时,有一个神秘的依赖问题。
$ spec spec/defines/rule_spec.rb
/home/jamie/git/puppet/modules/vanusers/spec/spec_helper.rb:1:in `require': no such file to load -- rspec-puppet (LoadError)
from /home/jamie/git/puppet/modules/vanusers/spec/spec_helper.rb:1
from ./spec/defines/rule_spec.rb:1:in `require'
from ./spec/defines/rule_spec.rb:1
from /usr/lib/ruby/1.8/spec/runner/example_group_runner.rb:15:in `load'
from /usr/lib/ruby/1.8/spec/runner/example_group_runner.rb:15:in `load_files'
from /usr/lib/ruby/1.8/spec/runner/example_group_runner.rb:14:in `each'
from /usr/lib/ruby/1.8/spec/runner/example_group_runner.rb:14:in `load_files'
from /usr/lib/ruby/1.8/spec/runner/options.rb:132:in `run_examples'
from /usr/lib/ruby/1.8/spec/runner/command_line.rb:9:in `run'
from /usr/bin/spec:3发布于 2013-12-20 08:55:50
spec_helper是一个需要出现在spec/spec_helper.rb中的包含文件。它通常包括测试功能所需的所有相关红宝石。
您应该查看手动设置指南,特别是spec_helper部件:http://rspec-puppet.com/setup/。
https://stackoverflow.com/questions/20667986
复制相似问题