vagrant-syllabus-provisioner 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 92441c2ce3ba699c450443a9f2df1c76a744f560
4
- data.tar.gz: f446c20430ab4356bd74fe1e84260b2a8f2345ac
3
+ metadata.gz: 182fece9164353fd620ac93b5f55ba5b2b4873fd
4
+ data.tar.gz: 2b7a6e5a29f7d60716ec989a4bea0f9bdeab7977
5
5
  SHA512:
6
- metadata.gz: eb78c50c83b43b160f555d45f1d96e55f6136d1a2b9e6dd9ab7c66d9b283db9c4ea8a73902249906ddba028531946c086a4a4f561b3c468b45e4f25eba3f18e8
7
- data.tar.gz: 5796da24adea8efe973fac2b2dbcf283f098ab14fdc70a5a84f1c9d790e629efe409b9664125d9deca699e426861cf122fcf62bd255842fe5748502010caeccb
6
+ metadata.gz: 32c6522a847ceb9c49e982a85d252ebd6f394f1bd6f5b22fc70abd7bd2d06770f25d8e772e9d112aa9845bc766282ec20bc9937c8848d4c7f0e33d1c03f76fc0
7
+ data.tar.gz: 15db86c06ccf5386b41003e6885d8a59b6bf070bd6968d1ab76dff6be8750cf57307761c0b7997339ff1f0aa263081917341e530fa6618d7647bbc59b038d695
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ -fd
@@ -11,6 +11,14 @@ module VagrantSyllabusProvisioner
11
11
  def finalize!
12
12
  @files = nil if @files == UNSET_VALUE
13
13
  end
14
+
15
+ def validate(machine)
16
+ if @files && !@files.is_a?(Array)
17
+ return {"syllabus" => ["files must be an array"]}
18
+ end
19
+
20
+ {}
21
+ end
14
22
  end
15
23
  end
16
24
 
@@ -9,10 +9,6 @@ module VagrantSyllabusProvisioner
9
9
  end
10
10
  end
11
11
 
12
- def finalize!
13
- p config
14
- end
15
-
16
12
  def provision
17
13
  with_backend do |backend|
18
14
  files.each do |file|
@@ -1,3 +1,3 @@
1
1
  module VagrantSyllabusProvisioner
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
@@ -0,0 +1,42 @@
1
+ require 'spec_helper'
2
+
3
+ module VagrantSyllabusProvisioner
4
+ describe VagrantSyllabusProvisioner::Config do
5
+ subject(:config) { described_class.new }
6
+
7
+ context "default" do
8
+ before { config.finalize! }
9
+ its(:files) { should be_nil }
10
+ end
11
+
12
+ context "set" do
13
+ before do
14
+ config.files = %w! a b !
15
+ config.finalize!
16
+ end
17
+ its(:files) { should eq %w! a b ! }
18
+ end
19
+
20
+ describe "#validate" do
21
+ context "with non-array files" do
22
+ before do
23
+ config.files = "non-array"
24
+ config.finalize!
25
+ end
26
+ it "returns a hash containing error messages" do
27
+ expect(config.validate(nil)).to eq({"syllabus" => ["files must be an array"]})
28
+ end
29
+ end
30
+ context "with array files" do
31
+ before do
32
+ config.files = %w! this is array !
33
+ config.finalize!
34
+ end
35
+ it "returns a hash containing no error messages" do
36
+ expect(config.validate(nil)).to eq({})
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+
@@ -0,0 +1,19 @@
1
+ require 'vagrant-syllabus-provisioner'
2
+
3
+ # This file was generated by the `rspec --init` command. Conventionally, all
4
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
5
+ # Require this file using `require "spec_helper"` to ensure that it is only
6
+ # loaded once.
7
+ #
8
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
9
+ RSpec.configure do |config|
10
+ config.treat_symbols_as_metadata_keys_with_true_values = true
11
+ config.run_all_when_everything_filtered = true
12
+ config.filter_run :focus
13
+
14
+ # Run specs in random order to surface order dependencies. If you find an
15
+ # order dependency and want to debug it, you can fix the order by providing
16
+ # the seed, which is printed after each run.
17
+ # --seed 1234
18
+ config.order = 'random'
19
+ end
@@ -22,4 +22,5 @@ Gem::Specification.new do |spec|
22
22
 
23
23
  spec.add_development_dependency "bundler"
24
24
  spec.add_development_dependency "rake"
25
+ spec.add_development_dependency "rspec"
25
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-syllabus-provisioner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryota Arai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-09 00:00:00.000000000 Z
11
+ date: 2013-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: syllabus
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  description: This plugin installs a provisioner that allows Syllabus to provision
56
70
  machines.
57
71
  email:
@@ -61,6 +75,7 @@ extensions: []
61
75
  extra_rdoc_files: []
62
76
  files:
63
77
  - .gitignore
78
+ - .rspec
64
79
  - Gemfile
65
80
  - LICENSE.txt
66
81
  - README.md
@@ -71,6 +86,8 @@ files:
71
86
  - lib/vagrant_syllabus_provisioner/provisioner.rb
72
87
  - lib/vagrant_syllabus_provisioner/spec_infra_backend.rb
73
88
  - lib/vagrant_syllabus_provisioner/version.rb
89
+ - spec/lib/vagrant_syllabus_provisioner/config_spec.rb
90
+ - spec/spec_helper.rb
74
91
  - vagrant-syllabus-provisioner.gemspec
75
92
  homepage: https://github.com/ryotarai/vagrant-syllabus-provisioner
76
93
  licenses:
@@ -96,4 +113,6 @@ rubygems_version: 2.0.3
96
113
  signing_key:
97
114
  specification_version: 4
98
115
  summary: Syllabus Provisioner for Vagrant
99
- test_files: []
116
+ test_files:
117
+ - spec/lib/vagrant_syllabus_provisioner/config_spec.rb
118
+ - spec/spec_helper.rb