generator_spec 0.9.3 → 0.9.4

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: b7e9059728e32e462c0ba6f3d27c2ff641f958d8
4
- data.tar.gz: 0256f4c0a7b39b431723ed4291f5e3b31a13eb9b
3
+ metadata.gz: f5f55ee0550c4513b26c1c9f37887564dc0742a9
4
+ data.tar.gz: 1941a360c254f91d1334bb029400577a4105d431
5
5
  SHA512:
6
- metadata.gz: 88e68ec9f6ae5c4b0ce18a68c6daabbf0bc65a15b325795dac059498b9bfe6cef524a64ad516c58012e2cec579bc94fa8e87cecd5d37be6bee58d0e7ee711ec4
7
- data.tar.gz: 3100f8a199176d304187d3e61ce3f5194f7654d95bb466f7c086e7fdcea0f81c9080447c767ce54fb078ad0aadbdff651c5933d981bdbc2a0218ef433ccc01d0
6
+ metadata.gz: c987a55fd84da2dd427184688e3acc495dfe0d356e6e796ddfbb6c9c9511daa2b4e33cb56b07edef3042de01516575b6ccdf4ed3a7a788e8ccc133ea7abf2545
7
+ data.tar.gz: e6d89ce7a9f778c785152e067d6e0d1ed3f726612c8deaa2971caa1768082ec6a8961cbc9b9946ff0207c32a2995d52dcc69c6c275a26eb93b8ec64b7ab204a6
data/README.md CHANGED
@@ -19,7 +19,7 @@ Spec (files in `spec/lib/generators` are recognized as generator type example gr
19
19
 
20
20
  require "generator_spec"
21
21
 
22
- describe TestGenerator do
22
+ describe TestGenerator, type: :generator do
23
23
  destination File.expand_path("../../tmp", __FILE__)
24
24
  arguments %w(something)
25
25
 
@@ -46,7 +46,7 @@ describe TestGenerator, "using custom matcher", type: :generator do
46
46
  end
47
47
 
48
48
  specify do
49
- destination_root.should have_structure {
49
+ expect(destination_root).to have_structure {
50
50
  no_file "test.rb"
51
51
  directory "config" do
52
52
  directory "initializers" do
@@ -131,6 +131,8 @@ module GeneratorSpec
131
131
  end
132
132
 
133
133
  def have_structure(&block)
134
+ error = 'You must pass a block to have_structure (Use {} instead of do/end!)'
135
+ raise RuntimeError, error unless block_given?
134
136
  Root.new(&block)
135
137
  end
136
138
  end
@@ -1,3 +1,3 @@
1
1
  module GeneratorSpec
2
- VERSION = '0.9.3'
2
+ VERSION = '0.9.4'
3
3
  end
@@ -44,7 +44,19 @@ describe TestGenerator, 'using custom matcher' do
44
44
  end
45
45
  end
46
46
  }
47
- }.to raise_error
47
+ }.to raise_error RSpec::Expectations::ExpectationNotMetError
48
+ end
49
+
50
+ it 'fails when it doesnt match with do/end instead of {}' do
51
+ expect {
52
+ expect(destination_root).to have_structure do
53
+ directory 'db' do
54
+ directory 'migrate' do
55
+ no_file '123_create_tests.rb'
56
+ end
57
+ end
58
+ end
59
+ }.to raise_error RuntimeError, /You must pass a block/
48
60
  end
49
61
  end
50
62
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: generator_spec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Hodgkiss
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-28 00:00:00.000000000 Z
11
+ date: 2017-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -102,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
102
  version: '0'
103
103
  requirements: []
104
104
  rubyforge_project: generator_spec
105
- rubygems_version: 2.2.2
105
+ rubygems_version: 2.6.11
106
106
  signing_key:
107
107
  specification_version: 4
108
108
  summary: Test Rails generators with RSpec
@@ -117,4 +117,3 @@ test_files:
117
117
  - spec/support/test_generator/templates/initializer.rb
118
118
  - spec/support/test_generator/templates/migration.rb
119
119
  - spec/support/test_generator/test_generator.rb
120
- has_rdoc: