generator_spec 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- generator_spec (0.0.3)
4
+ generator_spec (0.8.0)
5
5
  rails (~> 3.0)
6
6
  rspec-rails
7
7
 
data/README.md CHANGED
@@ -18,8 +18,9 @@ Spec:
18
18
 
19
19
  describe TestGenerator do
20
20
  include GeneratorSpec::TestCase
21
-
22
21
  destination File.expand_path("../../tmp", __FILE__)
22
+ tests TestGenerator
23
+ arguments %w(something)
23
24
 
24
25
  before(:all) do
25
26
  prepare_destination
@@ -35,7 +36,7 @@ An RSpec file matching DSL is also provided, taken with permission from [beard](
35
36
 
36
37
  describe TestGenerator, "using custom matcher" do
37
38
  include GeneratorSpec::TestCase
38
-
39
+ tests TestGenerator
39
40
  destination File.expand_path("../../tmp", __FILE__)
40
41
 
41
42
  before do
data/Rakefile CHANGED
@@ -1,2 +1,7 @@
1
1
  require 'bundler'
2
2
  Bundler::GemHelper.install_tasks
3
+
4
+ require 'rspec/core/rake_task'
5
+ RSpec::Core::RakeTask.new(:spec)
6
+
7
+ task :default => :spec
@@ -13,7 +13,6 @@ module GeneratorSpec
13
13
  included do
14
14
  cattr_accessor :test_case, :test_case_instance
15
15
  self.test_case = Class.new(Rails::Generators::TestCase)
16
- self.test_case.tests subject.call.class
17
16
  self.test_case_instance = self.test_case.new(:test)
18
17
  end
19
18
 
@@ -1,3 +1,3 @@
1
1
  module GeneratorSpec
2
- VERSION = "0.8.0"
2
+ VERSION = "0.8.1"
3
3
  end
@@ -2,9 +2,10 @@ require "spec_helper"
2
2
 
3
3
  describe TestGenerator, "using custom matcher" do
4
4
  include GeneratorSpec::TestCase
5
-
5
+ tests TestGenerator
6
6
  destination File.expand_path("../../tmp", __FILE__)
7
-
7
+ arguments %w(test)
8
+
8
9
  before do
9
10
  prepare_destination
10
11
  run_generator
@@ -250,6 +251,8 @@ module GeneratorSpec::Matcher
250
251
  end
251
252
 
252
253
  describe Root do
254
+ include FakeFS::SpecHelpers
255
+
253
256
  describe "#matches?" do
254
257
  before do
255
258
  @root = Root.new "test" do
@@ -257,12 +260,12 @@ module GeneratorSpec::Matcher
257
260
  end
258
261
  end
259
262
 
260
- it "returns false on no failures" do
263
+ it "returns true on no failures" do
261
264
  write_directory(TMP_ROOT.join("test/test_dir"))
262
265
  @root.matches?(TMP_ROOT).should be_true
263
266
  end
264
267
 
265
- it "returns true on failures" do
268
+ it "returns false on failures" do
266
269
  @root.matches?(TMP_ROOT).should be_false
267
270
  end
268
271
  end
@@ -7,7 +7,6 @@ end
7
7
  describe GeneratorSpec::TestCase do
8
8
  before do
9
9
  @klass = Class.new do
10
- self.should_receive(:subject).and_return(Proc.new {TestClass.new})
11
10
  include GeneratorSpec::TestCase
12
11
  end
13
12
  @klass.test_case_instance = mock
@@ -26,9 +25,10 @@ end
26
25
 
27
26
  describe TestGenerator, "using normal assert methods" do
28
27
  include GeneratorSpec::TestCase
29
-
28
+ tests TestGenerator
30
29
  destination File.expand_path("../../tmp", __FILE__)
31
-
30
+ arguments %w(test)
31
+
32
32
  before(:all) do
33
33
  prepare_destination
34
34
  run_generator
@@ -1,4 +1,5 @@
1
1
  class TestGenerator < Rails::Generators::Base
2
+ argument :name, :type => :string
2
3
  source_root File.expand_path('../templates', __FILE__)
3
4
 
4
5
  def copy_initializer
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: generator_spec
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.8.0
5
+ version: 0.8.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Steve Hodgkiss
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-03-02 00:00:00 +00:00
13
+ date: 2011-03-06 00:00:00 +00:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency