keynote 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of keynote might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Appraisals +3 -3
- data/CHANGELOG.md +5 -0
- data/README.md +2 -3
- data/gemfiles/rails30.gemfile +1 -1
- data/gemfiles/rails31.gemfile +1 -1
- data/gemfiles/rails32.gemfile +2 -2
- data/gemfiles/rails40.gemfile +2 -2
- data/gemfiles/rails41.gemfile +2 -2
- data/lib/generators/presenter_generator.rb +8 -4
- data/lib/keynote/testing/rspec.rb +1 -1
- data/lib/keynote/version.rb +1 -1
- data/spec/generator_spec.rb +90 -43
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9102d39344eda42029696b7429377d8f810ce744
|
4
|
+
data.tar.gz: 23184e1d37ce25d16d59c4cca69a328fee4ef1d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bf61eefce03db8ae56df92f06b194893885b72de489319dcbd07fd755f3882744d0c992af77c80dbff634d1b09f3858f01b61e8becc7135f7374fc8e25f1dd1
|
7
|
+
data.tar.gz: 0a626ab8db8b839edecbe915b16709b75860b716c067e6fc951288d4bc8b71a5d6ad3c053b5539d3c0d800ea7a19cc6f0cf8ae12e796aad9df4318d21a84a634
|
data/Appraisals
CHANGED
@@ -9,16 +9,16 @@ appraise "rails31" do
|
|
9
9
|
end
|
10
10
|
|
11
11
|
appraise "rails32" do
|
12
|
-
gem "rails", "3.2.
|
12
|
+
gem "rails", "3.2.17"
|
13
13
|
gem "minitest", "< 5"
|
14
14
|
end
|
15
15
|
|
16
16
|
appraise "rails40" do
|
17
|
-
gem "rails", "4.0.
|
17
|
+
gem "rails", "4.0.4"
|
18
18
|
gem "minitest", "< 5"
|
19
19
|
end
|
20
20
|
|
21
21
|
appraise "rails41" do
|
22
|
-
gem "rails", "4.1.0
|
22
|
+
gem "rails", "4.1.0"
|
23
23
|
gem "minitest", "~> 5.0"
|
24
24
|
end
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## v0.2.2
|
2
|
+
* Fix another RSpec integration bug, which happened in cases where the app's
|
3
|
+
Gemfile included rspec-rails but not the rspec gem itself.
|
4
|
+
* Fix a bug in the generation of specs for zero-arg presenters.
|
5
|
+
|
1
6
|
## v0.2.1
|
2
7
|
* Update configuration to test across MRI 1.9.2/1.9.3/2.0.0/2.1.0, Rubinius,
|
3
8
|
JRuby, Rails 3.0/3.1/3.2/4.0/4.1.
|
data/README.md
CHANGED
@@ -238,9 +238,8 @@ You can run Keynote's tests across all supported versions of Rails as follows:
|
|
238
238
|
|
239
239
|
``` bash
|
240
240
|
$ bundle install
|
241
|
-
$
|
242
|
-
$ rake appraisal
|
243
|
-
$ rake appraisal
|
241
|
+
$ bundle exec appraisal install
|
242
|
+
$ bundle exec rake appraisal
|
244
243
|
```
|
245
244
|
|
246
245
|
Feel free to submit pull requests according to the usual conventions for Ruby
|
data/gemfiles/rails30.gemfile
CHANGED
data/gemfiles/rails31.gemfile
CHANGED
data/gemfiles/rails32.gemfile
CHANGED
data/gemfiles/rails40.gemfile
CHANGED
data/gemfiles/rails41.gemfile
CHANGED
@@ -50,18 +50,22 @@ module Rails::Generators
|
|
50
50
|
'test/presenters', class_path, "#{file_name}_presenter_test.rb")
|
51
51
|
end
|
52
52
|
|
53
|
-
def
|
54
|
-
|
53
|
+
def presenter_name_and_target_list
|
54
|
+
[presenter_name, *target_names].join(', ')
|
55
55
|
end
|
56
56
|
|
57
|
-
def
|
58
|
-
|
57
|
+
def target_list
|
58
|
+
target_names.join(', ')
|
59
59
|
end
|
60
60
|
|
61
61
|
def presenter_name
|
62
62
|
class_name.sub(/Presenter$/, '').underscore.to_sym.inspect
|
63
63
|
end
|
64
64
|
|
65
|
+
def target_names
|
66
|
+
targets.map { |t| ":#{t}" }
|
67
|
+
end
|
68
|
+
|
65
69
|
if ::Rails.version.to_f < 3.1
|
66
70
|
protected
|
67
71
|
# This method doesn't exist in Rails 3.0
|
data/lib/keynote/version.rb
CHANGED
data/spec/generator_spec.rb
CHANGED
@@ -28,26 +28,76 @@ describe "generators" do
|
|
28
28
|
file_contents = File.read(File.join(output_path, path))
|
29
29
|
end
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
describe "when the test_framework is :test_unit" do
|
32
|
+
before do
|
33
|
+
Rails.application.config.generators do |g|
|
34
|
+
g.test_framework :test_unit
|
35
|
+
end
|
34
36
|
end
|
35
37
|
|
36
|
-
|
37
|
-
files
|
38
|
-
|
39
|
-
|
40
|
-
|
38
|
+
it "generates a presenter and Test::Unit file" do
|
39
|
+
invoke_generator 'post' do |files|
|
40
|
+
files.must_equal %w(
|
41
|
+
app/presenters/post_presenter.rb
|
42
|
+
test/unit/presenters/post_presenter_test.rb
|
43
|
+
)
|
41
44
|
|
42
|
-
|
43
|
-
|
45
|
+
file_contents('app/presenters/post_presenter.rb').
|
46
|
+
must_match /class PostPresenter < Keynote::Presenter/
|
44
47
|
|
45
|
-
|
46
|
-
|
48
|
+
file_contents('test/unit/presenters/post_presenter_test.rb').
|
49
|
+
must_match /class PostPresenterTest < Keynote::TestCase/
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
it "does not add a 'presents' line" do
|
54
|
+
invoke_generator 'post' do |files|
|
55
|
+
file_contents('app/presenters/post_presenter.rb').
|
56
|
+
wont_match /presents/
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
it "generates an appropriate present() call" do
|
61
|
+
invoke_generator 'post' do |files|
|
62
|
+
file_contents('test/unit/presenters/post_presenter_test.rb').
|
63
|
+
must_match /present\(:post\)/
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
describe "when the presenter has one parameter" do
|
68
|
+
it "adds a 'presents' line" do
|
69
|
+
invoke_generator 'post', 'foo' do |files|
|
70
|
+
file_contents('app/presenters/post_presenter.rb').
|
71
|
+
must_match /presents :foo$/
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
it "generates an appropriate present() call" do
|
76
|
+
invoke_generator 'post', 'foo' do |files|
|
77
|
+
file_contents('test/unit/presenters/post_presenter_test.rb').
|
78
|
+
must_match /present\(:post, :foo\)/
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
describe "when the presenter has two parameters" do
|
84
|
+
it "adds a 'presents' line" do
|
85
|
+
invoke_generator 'post', 'foo', 'bar' do |files|
|
86
|
+
file_contents('app/presenters/post_presenter.rb').
|
87
|
+
must_match /presents :foo, :bar$/
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
it "generates an appropriate present() call" do
|
92
|
+
invoke_generator 'post', 'foo', 'bar' do |files|
|
93
|
+
file_contents('test/unit/presenters/post_presenter_test.rb').
|
94
|
+
must_match /present\(:post, :foo, :bar\)/
|
95
|
+
end
|
96
|
+
end
|
47
97
|
end
|
48
98
|
end
|
49
99
|
|
50
|
-
it "
|
100
|
+
it "generates a presenter and RSpec file" do
|
51
101
|
Rails.application.config.generators do |g|
|
52
102
|
g.test_framework :rspec
|
53
103
|
end
|
@@ -66,44 +116,41 @@ describe "generators" do
|
|
66
116
|
end
|
67
117
|
end
|
68
118
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
g.test_framework :mini_test, :spec => true
|
74
|
-
end
|
119
|
+
it "generates a presenter and MiniTest::Rails spec file" do
|
120
|
+
Rails.application.config.generators do |g|
|
121
|
+
g.test_framework :mini_test, :spec => true
|
122
|
+
end
|
75
123
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
124
|
+
invoke_generator 'post' do |files|
|
125
|
+
files.must_equal %w(
|
126
|
+
app/presenters/post_presenter.rb
|
127
|
+
test/presenters/post_presenter_test.rb
|
128
|
+
)
|
81
129
|
|
82
|
-
|
83
|
-
|
130
|
+
file_contents('app/presenters/post_presenter.rb').
|
131
|
+
must_match /class PostPresenter < Keynote::Presenter/
|
84
132
|
|
85
|
-
|
86
|
-
|
87
|
-
end
|
133
|
+
file_contents('test/presenters/post_presenter_test.rb').
|
134
|
+
must_match /describe PostPresenter do/
|
88
135
|
end
|
136
|
+
end
|
89
137
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
138
|
+
it "generates a presenter and MiniTest::Rails unit file" do
|
139
|
+
Rails.application.config.generators do |g|
|
140
|
+
g.test_framework :mini_test, :spec => false
|
141
|
+
end
|
94
142
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
143
|
+
invoke_generator 'post' do |files|
|
144
|
+
files.must_equal %w(
|
145
|
+
app/presenters/post_presenter.rb
|
146
|
+
test/presenters/post_presenter_test.rb
|
147
|
+
)
|
100
148
|
|
101
|
-
|
102
|
-
|
149
|
+
file_contents('app/presenters/post_presenter.rb').
|
150
|
+
must_match /class PostPresenter < Keynote::Presenter/
|
103
151
|
|
104
|
-
|
105
|
-
|
106
|
-
end
|
152
|
+
file_contents('test/presenters/post_presenter_test.rb').
|
153
|
+
must_match /class PostPresenterTest < Keynote::TestCase/
|
107
154
|
end
|
108
155
|
end
|
109
156
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: keynote
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Fitzgerald
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -223,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
223
223
|
version: '0'
|
224
224
|
requirements: []
|
225
225
|
rubyforge_project:
|
226
|
-
rubygems_version: 2.
|
226
|
+
rubygems_version: 2.2.2
|
227
227
|
signing_key:
|
228
228
|
specification_version: 4
|
229
229
|
summary: Flexible presenters for Rails.
|