File tree 4 files changed +35
-3
lines changed
generators/draper/decorator
4 files changed +35
-3
lines changed Original file line number Diff line number Diff line change @@ -5,4 +5,5 @@ Gemfile.lock
5
5
pkg /*
6
6
coverage.data
7
7
coverage /*
8
- .yardoc
8
+ .yardoc
9
+ tmp
Original file line number Diff line number Diff line change 1
1
source :rubygems
2
2
3
3
gem 'rake'
4
- gem 'rspec' , '~> 2.0.1 '
4
+ gem 'rspec' , '~> 2.0'
5
5
gem 'activesupport' , '~> 3.0.10'
6
6
gem 'actionpack' , "~> 3.0.10" , :require => 'action_view'
7
+ gem 'ammeter' , '~> 0.1.3'
7
8
gem 'guard'
8
9
gem 'guard-rspec'
9
10
gem 'launchy'
Original file line number Diff line number Diff line change
1
+ require 'spec_helper'
2
+
3
+ # Generators are not automatically loaded by Rails
4
+ require 'generators/draper/decorator/decorator_generator'
5
+
6
+ describe Draper ::DecoratorGenerator do
7
+ # Tell the generator where to put its output (what it thinks of as Rails.root)
8
+ destination File . expand_path ( "../../../../../tmp" , __FILE__ )
9
+
10
+ before { prepare_destination }
11
+
12
+ describe 'no arguments' do
13
+ before { run_generator %w( products ) }
14
+
15
+ describe 'app/decorators/application_decorator.rb' do
16
+ subject { file ( 'app/decorators/application_decorator.rb' ) }
17
+ it { should exist }
18
+ it { should contain "class ApplicationDecorator < Draper::Base" }
19
+ end
20
+
21
+ describe 'app/decorators/products_decorator.rb' do
22
+ subject { file ( 'app/decorators/products_decorator.rb' ) }
23
+ it { should exist }
24
+ it { should contain "class ProductsDecorator < ApplicationDecorator" }
25
+ end
26
+
27
+ end
28
+ end
Original file line number Diff line number Diff line change 5
5
require './spec/samples/application_helper.rb'
6
6
Dir . glob ( [ './spec/samples/*.rb' , './spec/support/*.rb' ] ) do |file |
7
7
require file
8
- end
8
+ end
9
+
10
+ require 'ammeter/init'
You can’t perform that action at this time.
0 commit comments