generator_spec 0.9.2 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b7e9059728e32e462c0ba6f3d27c2ff641f958d8
4
+ data.tar.gz: 0256f4c0a7b39b431723ed4291f5e3b31a13eb9b
5
+ SHA512:
6
+ metadata.gz: 88e68ec9f6ae5c4b0ce18a68c6daabbf0bc65a15b325795dac059498b9bfe6cef524a64ad516c58012e2cec579bc94fa8e87cecd5d37be6bee58d0e7ee711ec4
7
+ data.tar.gz: 3100f8a199176d304187d3e61ce3f5194f7654d95bb466f7c086e7fdcea0f81c9080447c767ce54fb078ad0aadbdff651c5933d981bdbc2a0218ef433ccc01d0
@@ -1,6 +1,11 @@
1
1
  language: ruby
2
+ sudo: false
3
+ cache: bundler
2
4
  rvm:
5
+ - 2.1
3
6
  - 2.0.0
4
- - 1.9.3
5
- - jruby-19mode
6
- - rbx-19mode
7
+ - jruby
8
+ - rbx-2
9
+ matrix:
10
+ allow_failures:
11
+ - rvm: jruby
data/Gemfile CHANGED
@@ -1,3 +1,8 @@
1
1
  source "http://rubygems.org"
2
2
 
3
+ platforms :rbx do
4
+ gem 'rubysl', '~> 2.0'
5
+ gem 'rubinius-developer_tools'
6
+ end
7
+
3
8
  gemspec
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Generator Spec
1
+ # Generator Spec [![Build Status](https://travis-ci.org/stevehodgkiss/generator_spec.svg?branch=master)](https://travis-ci.org/stevehodgkiss/generator_spec)
2
2
 
3
3
  Test Rails generators with RSpec using the standard Rails::Generators::TestCase assertion methods.
4
4
 
@@ -21,5 +21,5 @@ Gem::Specification.new do |s|
21
21
  s.require_paths = ["lib"]
22
22
  s.add_dependency 'activesupport', ['>= 3.0.0']
23
23
  s.add_dependency 'railties', ['>= 3.0.0']
24
- s.add_development_dependency 'rspec', '>= 2.14.0'
24
+ s.add_development_dependency 'rspec', '~> 3.0'
25
25
  end
@@ -6,7 +6,5 @@ RSpec::configure do |c|
6
6
  Regexp.compile(parts.join('[\\\/]') + '[\\\/]')
7
7
  end
8
8
 
9
- c.include GeneratorSpec::GeneratorExampleGroup, :type => :generator, :example_group => {
10
- :file_path => c.escaped_path(%w[spec lib generators])
11
- }
9
+ c.include GeneratorSpec::GeneratorExampleGroup, :type => :generator, :file_path => c.escaped_path(%w[spec lib generators])
12
10
  end
@@ -1,3 +1,3 @@
1
1
  module GeneratorSpec
2
- VERSION = '0.9.2'
2
+ VERSION = '0.9.3'
3
3
  end
@@ -2,6 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  module GeneratorSpec
4
4
  describe GeneratorExampleGroup do
5
- it { should be_included_in_files_in('./spec/lib/generators/') }
5
+ it { is_expected.to be_included_in_files_in('./spec/lib/generators/') }
6
6
  end
7
7
  end
@@ -15,7 +15,7 @@ describe TestGenerator, 'using custom matcher' do
15
15
  end
16
16
 
17
17
  specify do
18
- destination_root.should have_structure {
18
+ expect(destination_root).to have_structure {
19
19
  no_file 'test.rb'
20
20
  directory 'config' do
21
21
  directory 'initializers' do
@@ -37,7 +37,7 @@ describe TestGenerator, 'using custom matcher' do
37
37
 
38
38
  it 'fails when it doesnt match' do
39
39
  expect {
40
- destination_root.should have_structure {
40
+ expect(destination_root).to have_structure {
41
41
  directory 'db' do
42
42
  directory 'migrate' do
43
43
  no_file '123_create_tests.rb'
@@ -145,7 +145,7 @@ module GeneratorSpec
145
145
  describe Directory do
146
146
  describe '#location' do
147
147
  it 'equals the full path' do
148
- Directory.new('test').location('test_2').should eq('test/test_2')
148
+ expect(Directory.new('test').location('test_2')).to eq('test/test_2')
149
149
  end
150
150
  end
151
151
 
@@ -155,7 +155,7 @@ module GeneratorSpec
155
155
  dir = Directory.new 'test' do
156
156
  directory 'dir'
157
157
  end
158
- dir.tree['dir'].should eq(false)
158
+ expect(dir.tree['dir']).to eq(false)
159
159
  end
160
160
  end
161
161
 
@@ -166,8 +166,8 @@ module GeneratorSpec
166
166
  directory 'test_2'
167
167
  end
168
168
  end
169
- dir.tree['dir'].should be_an_instance_of(Directory)
170
- dir.tree['dir'].tree['test_2'].should eq(false)
169
+ expect(dir.tree['dir']).to be_an_instance_of(Directory)
170
+ expect(dir.tree['dir'].tree['test_2']).to eq(false)
171
171
  end
172
172
  end
173
173
  end
@@ -177,7 +177,7 @@ module GeneratorSpec
177
177
  dir = Directory.new 'test' do
178
178
  file 'test_file'
179
179
  end
180
- dir.tree['test_file'].should be_an_instance_of(File)
180
+ expect(dir.tree['test_file']).to be_an_instance_of(File)
181
181
  end
182
182
  end
183
183
 
@@ -186,8 +186,8 @@ module GeneratorSpec
186
186
  dir = Directory.new 'test' do
187
187
  migration 'test_file'
188
188
  end
189
- dir.tree['test_file'].should be_an_instance_of(Migration)
190
- dir.tree['test_file'].instance_variable_get('@name').should eq('test/test_file')
189
+ expect(dir.tree['test_file']).to be_an_instance_of(Migration)
190
+ expect(dir.tree['test_file'].instance_variable_get('@name')).to eq('test/test_file')
191
191
  end
192
192
  end
193
193
 
@@ -287,11 +287,11 @@ module GeneratorSpec
287
287
 
288
288
  it 'returns true on no failures' do
289
289
  write_directory(TMP_ROOT.join('test/test_dir'))
290
- root.matches?(TMP_ROOT).should be_true
290
+ expect(root.matches?(TMP_ROOT)).to be_truthy
291
291
  end
292
292
 
293
293
  it 'returns false on failures' do
294
- root.matches?(TMP_ROOT).should be_false
294
+ expect(root.matches?(TMP_ROOT)).to be_falsey
295
295
  end
296
296
  end
297
297
  end
@@ -7,20 +7,22 @@ end
7
7
  describe GeneratorSpec::TestCase do
8
8
  before do
9
9
  @klass = Class.new do
10
- self.should_receive(:described_class).and_return(TestClass)
10
+ def self.described_class
11
+ TestClass
12
+ end
11
13
  include GeneratorSpec::TestCase
12
14
  end
13
15
  @klass.test_case_instance = double
14
16
  end
15
17
 
16
18
  it 'passes unknown messages on to test_case_instance' do
17
- @klass.test_case_instance.should_receive(:assert_file).with('test')
19
+ expect(@klass.test_case_instance).to receive(:assert_file).with('test')
18
20
  @klass.new.assert_file('test')
19
21
  end
20
22
 
21
23
  it 'handles respond_to accordingly' do
22
- @klass.test_case_instance.should_receive(:respond_to?).with(:assert_no_file).and_return(true)
23
- @klass.new.respond_to?(:assert_no_file).should be_true
24
+ expect(@klass.test_case_instance).to receive(:respond_to?).with(:assert_no_file).and_return(true)
25
+ expect(@klass.new.respond_to?(:assert_no_file)).to be_truthy
24
26
  end
25
27
  end
26
28
 
@@ -2,19 +2,11 @@
2
2
  module Helpers
3
3
  def stub_metadata(additional_metadata)
4
4
  stub_metadata = metadata_with(additional_metadata)
5
- RSpec::Core::ExampleGroup.stub(:metadata) { stub_metadata }
5
+ allow(RSpec::Core::ExampleGroup).to receive(:metadata) { stub_metadata }
6
6
  end
7
7
 
8
8
  def metadata_with(additional_metadata)
9
- m = RSpec::Core::Metadata.new
10
- m.process("example group")
11
-
12
- group_metadata = additional_metadata.delete(:example_group)
13
- if group_metadata
14
- m[:example_group].merge!(group_metadata)
15
- end
16
- m.merge!(additional_metadata)
17
- m
9
+ ::RSpec.describe("example group").metadata.merge(additional_metadata)
18
10
  end
19
11
 
20
12
  RSpec.configure {|c| c.include self}
@@ -3,7 +3,7 @@
3
3
  RSpec::Matchers::define :be_included_in_files_in do |path|
4
4
  match do |mod|
5
5
  stub_metadata(
6
- :example_group => {:file_path => "#{path}whatever_spec.rb:15"}
6
+ :file_path => "#{path}whatever_spec.rb:15"
7
7
  )
8
8
  group = RSpec::Core::ExampleGroup.describe
9
9
  group.included_modules.include?(mod)
metadata CHANGED
@@ -1,64 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: generator_spec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
5
- prerelease:
4
+ version: 0.9.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Steve Hodgkiss
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-11-15 00:00:00.000000000 Z
11
+ date: 2014-11-28 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: activesupport
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: 3.0.0
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: 3.0.0
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: railties
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: 3.0.0
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: 3.0.0
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rspec
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - "~>"
52
46
  - !ruby/object:Gem::Version
53
- version: 2.14.0
47
+ version: '3.0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - "~>"
60
53
  - !ruby/object:Gem::Version
61
- version: 2.14.0
54
+ version: '3.0'
62
55
  description: Test Rails generators with RSpec
63
56
  email:
64
57
  - steve@hodgkiss.me.uk
@@ -66,9 +59,9 @@ executables: []
66
59
  extensions: []
67
60
  extra_rdoc_files: []
68
61
  files:
69
- - .gitignore
70
- - .rspec
71
- - .travis.yml
62
+ - ".gitignore"
63
+ - ".rspec"
64
+ - ".travis.yml"
72
65
  - Gemfile
73
66
  - MIT-LICENSE
74
67
  - README.md
@@ -92,27 +85,26 @@ files:
92
85
  homepage: https://github.com/stevehodgkiss/generator_spec
93
86
  licenses:
94
87
  - MIT
88
+ metadata: {}
95
89
  post_install_message:
96
90
  rdoc_options: []
97
91
  require_paths:
98
92
  - lib
99
93
  required_ruby_version: !ruby/object:Gem::Requirement
100
- none: false
101
94
  requirements:
102
- - - ! '>='
95
+ - - ">="
103
96
  - !ruby/object:Gem::Version
104
97
  version: '0'
105
98
  required_rubygems_version: !ruby/object:Gem::Requirement
106
- none: false
107
99
  requirements:
108
- - - ! '>='
100
+ - - ">="
109
101
  - !ruby/object:Gem::Version
110
102
  version: '0'
111
103
  requirements: []
112
104
  rubyforge_project: generator_spec
113
- rubygems_version: 1.8.23
105
+ rubygems_version: 2.2.2
114
106
  signing_key:
115
- specification_version: 3
107
+ specification_version: 4
116
108
  summary: Test Rails generators with RSpec
117
109
  test_files:
118
110
  - spec/generator_spec/generator_example_group_spec.rb