genspec 0.3.1 → 0.3.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: 75981b2df31e29244d8c38691d098fb64fab64d0
4
- data.tar.gz: b7bf7d18e376bfd62dde9c7a4c6c004fc3ff6724
3
+ metadata.gz: 90d6e7ee1337b4a3c20038fd3527f7e9a51bb8f8
4
+ data.tar.gz: e3743f3e0ddf711cdafb637c8debab9338d91f48
5
5
  SHA512:
6
- metadata.gz: 95cd7496ca88976ff649f652cfd4cea630a76b62399c052add342e4e52882a0e5c1b4b04edb2a33190fd37c6eb8e95b1fa3fd85d3ef0345c0c53412d5587ce3c
7
- data.tar.gz: faffdeff2700c52728ebe15c368573523c771e0dd5b0aafefd38d37990d1fd544bf629cb496c9fb0ae264cc0057d86af1f494f4b42e4885cd7dfa8def6d076db
6
+ metadata.gz: ce6b36e9478a07476358f97d190eb56c3a24b042ff21064c6faba939866bcc6329c3cde4269c85a9c8c87144e724d6a7bedebc4dfcf2548fc074e721bc683228
7
+ data.tar.gz: 4068692392fe63cc4e49c73f4f4b6a9ea55d1171d06947b9458c21391f250ce60c3c1f3b2029b2b77ef890b73aa7650939eaad6509973cf6295b779cda62daaf
@@ -19,7 +19,7 @@ module GenSpec
19
19
  end
20
20
 
21
21
  def matches?(generator)
22
- @described = generator[:described].to_s
22
+ @described = generator[:described]
23
23
  base = nil
24
24
  base, @described = @described.split(/:/) if @described =~ /:/
25
25
  @args = generator[:args]
@@ -31,9 +31,9 @@ module GenSpec
31
31
  @generator = @described
32
32
  else
33
33
  if GenSpec.rails?
34
- @generator = Rails::Generators.find_by_namespace(@described, base)
34
+ @generator = Rails::Generators.find_by_namespace(@described.to_s, base)
35
35
  else
36
- @generator = Thor::Util.find_by_namespace(@described)
36
+ @generator = Thor::Util.find_by_namespace(@described.to_s)
37
37
  end
38
38
  end
39
39
 
@@ -2,7 +2,7 @@ module GenSpec
2
2
  class Version
3
3
  MAJOR = 0
4
4
  MINOR = 3
5
- PATCH = 1
5
+ PATCH = 2
6
6
  RELEASE = nil
7
7
 
8
8
  STRING = (RELEASE ? [MAJOR, MINOR, PATCH, RELEASE] : [MAJOR, MINOR, PATCH]).join('.')
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe :question do
3
+ shared_examples_for 'the question generator' do
4
4
  context "without input" do
5
5
  it "should raise an error" do
6
6
  expect(proc { expect(subject).to output("Are you a GOD?")
@@ -31,3 +31,13 @@ describe :question do
31
31
  end
32
32
  end
33
33
  end
34
+
35
+ # test that we can pass a generator by class, there's no reason this shouldn't
36
+ # be possible
37
+ describe Question do
38
+ it_should_behave_like 'the question generator'
39
+ end
40
+
41
+ describe :question do
42
+ it_should_behave_like 'the question generator'
43
+ end
@@ -27,10 +27,14 @@ module CustomActions
27
27
  end
28
28
 
29
29
  require 'genspec'
30
+ # always load this one, because we'll reference it by class name in specs,
31
+ # so it has to be defined before they load.
32
+ require File.expand_path('support/generators/question/question_generator', File.dirname(__FILE__))
30
33
  unless GenSpec.rails?
34
+ # only load this one when rails isn't around, because rails should autoload
35
+ # it if rails is in use
31
36
  require 'thor/group'
32
37
  require File.expand_path('support/generators/test_rails3/test_rails3_generator', File.dirname(__FILE__))
33
- require File.expand_path('support/generators/question/question_generator', File.dirname(__FILE__))
34
38
  end
35
39
 
36
40
  if RSpec::Expectations.respond_to?(:configuration)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: genspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Colin MacKenzie IV