为什么rspec-puppet找不到我的班级?

时间:2016-06-11 09:00:04

标签: puppet rspec-puppet

我已经创建了一个Puppet模块来安装AWS Cloudwatch监控脚本并进行设置。 Puppet模块可用here

当我运行rake spec时,我的测试套件失败了:

rspec ./spec/classes/init_spec.rb:4 # cloudwatch with default values for all parameters should contain Class[cloudwatch]

我不能为我的生活弄清楚为什么这个测试失败了。我该如何解决?

我尝试使用以下内容在回购根目录中创建.fixtures/yml

fixtures:
  symlinks:
    cloudwatch: "../../../../manifests"

fixtures:
  symlinks:
    cloudwatch: "#{source_dir}"

但没有骰子。

我还尝试使用符号链接链接到清单目录:https://github.com/MasterRoot24/puppet-cloudwatch/commit/932970aab085984f2cda44fba841c3bde20f7a2b

1 个答案:

答案 0 :(得分:1)

您最初的问题是您错过了fixtures: symlinks: cloudwatch: "#{source_dir}" 文件,该文件需要以下内容:

fixtures

puppetlabs_spec_helper README中所述。

需要进行其他更改以使测试通过,如我刚刚提出的PR here所示。

回答您编辑的问题,该问题讨论了您所链接的代码中没有的灯具文件,我不认为您的灯具在语法上有效;我不相信你可以指定多个-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { // .... YOUR CURRENT CODE // Color change as you wanted it.,, if (YOUR_CELL_INDEX % 3 == 0) { cell.backgroundColor = [UIColor whiteColor]; } else { YOUR_CELL_INDEX % 3 == 1) { cell.backgroundColor = [UIColor blackColor]; } else { cell.backgroundColor = // Your choice of color.... } // .... REST OF YOUR CODE & return cell; } 块。无论如何,看看我的公关。