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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fe0ac56847bb40c91206e3e3e40854bf60efd579
4
- data.tar.gz: b81181cb6d60f7cbf441d9724a809977e7293de2
3
+ metadata.gz: 9102d39344eda42029696b7429377d8f810ce744
4
+ data.tar.gz: 23184e1d37ce25d16d59c4cca69a328fee4ef1d0
5
5
  SHA512:
6
- metadata.gz: 3b11e1e2610c5f467911bb09a90bd2d98cb410a256033fa252e03eebb6797ac706739c4a23332312979bfc29824fe7d132493c890be0f4a5f6aa39fb98547ee0
7
- data.tar.gz: 08927b3f127d54403e289798d728d88ba6a8b50085ef71f475308d6f34811f3c74ed1822914980e4b23f6b3e53820056a30ac84ed26a25f6d8f1bb15c6be44b5
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.16"
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.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.beta1"
22
+ gem "rails", "4.1.0"
23
23
  gem "minitest", "~> 5.0"
24
24
  end
@@ -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
- $ rake appraisal:gemfiles
242
- $ rake appraisal:install
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
@@ -5,4 +5,4 @@ source "https://rubygems.org"
5
5
  gem "rails", "3.0.20"
6
6
  gem "minitest", "< 5"
7
7
 
8
- gemspec :path=>"../"
8
+ gemspec :path => "../"
@@ -5,4 +5,4 @@ source "https://rubygems.org"
5
5
  gem "rails", "3.1.12"
6
6
  gem "minitest", "< 5"
7
7
 
8
- gemspec :path=>"../"
8
+ gemspec :path => "../"
@@ -2,7 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "3.2.16"
5
+ gem "rails", "3.2.17"
6
6
  gem "minitest", "< 5"
7
7
 
8
- gemspec :path=>"../"
8
+ gemspec :path => "../"
@@ -2,7 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "4.0.0"
5
+ gem "rails", "4.0.4"
6
6
  gem "minitest", "< 5"
7
7
 
8
- gemspec :path=>"../"
8
+ gemspec :path => "../"
@@ -2,7 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "4.1.0.beta1"
5
+ gem "rails", "4.1.0"
6
6
  gem "minitest", "~> 5.0"
7
7
 
8
- gemspec :path=>"../"
8
+ gemspec :path => "../"
@@ -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 target_list
54
- targets.map { |t| ":#{t}" }.join(', ')
53
+ def presenter_name_and_target_list
54
+ [presenter_name, *target_names].join(', ')
55
55
  end
56
56
 
57
- def presenter_name_and_target_list
58
- [presenter_name, *target_list].join(', ')
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
@@ -1,6 +1,6 @@
1
1
  # encoding: UTF-8
2
2
 
3
- require "rspec"
3
+ require "rspec/core"
4
4
  require "keynote/testing/test_present_method"
5
5
 
6
6
  module Keynote
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Keynote
4
4
  # @private
5
- VERSION = "0.2.1"
5
+ VERSION = "0.2.2"
6
6
  end
@@ -28,26 +28,76 @@ describe "generators" do
28
28
  file_contents = File.read(File.join(output_path, path))
29
29
  end
30
30
 
31
- it "should generate a presenter and Test::Unit file" do
32
- Rails.application.config.generators do |g|
33
- g.test_framework :test_unit, :spec => true
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
- invoke_generator 'post' do |files|
37
- files.must_equal %w(
38
- app/presenters/post_presenter.rb
39
- test/unit/presenters/post_presenter_test.rb
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
- file_contents('app/presenters/post_presenter.rb').
43
- must_match /class PostPresenter < Keynote::Presenter/
45
+ file_contents('app/presenters/post_presenter.rb').
46
+ must_match /class PostPresenter < Keynote::Presenter/
44
47
 
45
- file_contents('test/unit/presenters/post_presenter_test.rb').
46
- must_match /class PostPresenterTest < Keynote::TestCase/
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 "should generate a presenter and RSpec file" do
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
- # Temporary workaround until MT::R supports MT5 and Rails 4.1
70
- unless Rails::VERSION.to_s.start_with? "4.1.0"
71
- it "should generate a presenter and MiniTest::Rails spec file" do
72
- Rails.application.config.generators do |g|
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
- invoke_generator 'post' do |files|
77
- files.must_equal %w(
78
- app/presenters/post_presenter.rb
79
- test/presenters/post_presenter_test.rb
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
- file_contents('app/presenters/post_presenter.rb').
83
- must_match /class PostPresenter < Keynote::Presenter/
130
+ file_contents('app/presenters/post_presenter.rb').
131
+ must_match /class PostPresenter < Keynote::Presenter/
84
132
 
85
- file_contents('test/presenters/post_presenter_test.rb').
86
- must_match /describe PostPresenter do/
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
- it "should generate a presenter and MiniTest::Rails unit file" do
91
- Rails.application.config.generators do |g|
92
- g.test_framework :mini_test, :spec => false
93
- end
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
- invoke_generator 'post' do |files|
96
- files.must_equal %w(
97
- app/presenters/post_presenter.rb
98
- test/presenters/post_presenter_test.rb
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
- file_contents('app/presenters/post_presenter.rb').
102
- must_match /class PostPresenter < Keynote::Presenter/
149
+ file_contents('app/presenters/post_presenter.rb').
150
+ must_match /class PostPresenter < Keynote::Presenter/
103
151
 
104
- file_contents('test/presenters/post_presenter_test.rb').
105
- must_match /class PostPresenterTest < Keynote::TestCase/
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.1
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-01-20 00:00:00.000000000 Z
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.0.14
226
+ rubygems_version: 2.2.2
227
227
  signing_key:
228
228
  specification_version: 4
229
229
  summary: Flexible presenters for Rails.