typo 5.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES-5.0 +82 -0
- data/app/controllers/articles_controller.rb +4 -4
- data/app/helpers/admin/base_helper.rb +9 -6
- data/app/models/blog_sweeper.rb +5 -0
- data/app/models/page_cache.rb +12 -6
- data/app/models/user.rb +7 -2
- data/app/views/admin/categories/show.html.erb +3 -3
- data/app/views/admin/content/_articles.html.erb +1 -1
- data/app/views/admin/general/index.html.erb +4 -4
- data/app/views/admin/sidebar/index.html.erb +1 -1
- data/app/views/admin/themes/index.html.erb +1 -1
- data/config/environments/development.rb +1 -1
- data/db/migrate/066_fix_profiles.rb +20 -0
- data/db/schema.rb +2 -2
- data/lib/tasks/release.rake +1 -8
- data/lib/typo_version.rb +1 -1
- data/spec/controllers/articles_controller_spec.rb +1 -1
- data/spec/fixtures/contents.yml +3 -13
- data/spec/fixtures/profiles.yml +11 -0
- data/spec/fixtures/tags.yml +0 -3
- data/spec/models/page_spec.rb +7 -4
- data/spec/models/tag_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- data/test/fixtures/profiles.yml +1 -6
- data/test/fixtures/users.yml +8 -8
- data/vendor/plugins/rspec/CHANGES +1 -9
- data/vendor/plugins/rspec/examples/pure/helper_method_example.rb +6 -9
- data/vendor/plugins/rspec/lib/spec/example/example_methods.rb +8 -9
- data/vendor/plugins/rspec/lib/spec/matchers.rb +7 -1
- data/vendor/plugins/rspec/lib/spec/matchers/be.rb +2 -3
- data/vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb +3 -10
- data/vendor/plugins/rspec/lib/spec/runner/formatter/story/plain_text_formatter.rb +5 -8
- data/vendor/plugins/rspec/lib/spec/story/runner/story_parser.rb +8 -8
- data/vendor/plugins/rspec/lib/spec/story/runner/story_runner.rb +0 -1
- data/vendor/plugins/rspec/lib/spec/version.rb +1 -1
- data/vendor/plugins/rspec/spec/spec/example/example_methods_spec.rb +0 -16
- data/vendor/plugins/rspec/spec/spec/matchers/match_spec.rb +3 -3
- data/vendor/plugins/rspec/spec/spec/runner/formatter/story/plain_text_formatter_spec.rb +4 -45
- data/vendor/plugins/rspec/spec/spec/story/runner/story_runner_spec.rb +0 -37
- data/vendor/plugins/rspec/stories/example_groups/autogenerated_docstrings +8 -27
- data/vendor/plugins/rspec/stories/example_groups/output +0 -5
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/helper_example_group.rb +1 -0
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/have_text.rb +2 -2
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/version.rb +1 -1
- data/vendor/plugins/rspec_on_rails/spec/rails/matchers/render_spec.rb +46 -0
- metadata +5 -7
- data/spec/fixtures/articles_tags.yml +0 -19
- data/vendor/plugins/rspec/failing_examples/failing_autogenerated_docstrings_example.rb +0 -19
- data/vendor/plugins/rspec/stories/resources/stories/failing_story.rb +0 -15
- data/vendor/plugins/rspec_on_rails/spec/rails/matchers/have_text_spec.rb +0 -62
@@ -213,43 +213,6 @@ module Spec
|
|
213
213
|
# then
|
214
214
|
$scenario.name.should == 'first scenario'
|
215
215
|
end
|
216
|
-
|
217
|
-
it "should clean the steps between stories" do
|
218
|
-
#given
|
219
|
-
story_runner = StoryRunner.new(ScenarioRunner.new)
|
220
|
-
result = mock 'result'
|
221
|
-
|
222
|
-
step1 = Step.new('step') do
|
223
|
-
result.one
|
224
|
-
end
|
225
|
-
steps1 = StepGroup.new
|
226
|
-
steps1.add :when, step1
|
227
|
-
|
228
|
-
story_runner.Story 'title', 'narrative', :steps => steps1 do
|
229
|
-
Scenario 'first scenario' do
|
230
|
-
When 'step'
|
231
|
-
end
|
232
|
-
end
|
233
|
-
|
234
|
-
step2 = Step.new('step') do
|
235
|
-
result.two
|
236
|
-
end
|
237
|
-
steps2 = StepGroup.new
|
238
|
-
steps2.add :when, step2
|
239
|
-
|
240
|
-
story_runner.Story 'title2', 'narrative', :steps => steps2 do
|
241
|
-
Scenario 'second scenario' do
|
242
|
-
When 'step'
|
243
|
-
end
|
244
|
-
end
|
245
|
-
|
246
|
-
#then
|
247
|
-
result.should_receive(:one)
|
248
|
-
result.should_receive(:two)
|
249
|
-
|
250
|
-
#when
|
251
|
-
story_runner.run_stories
|
252
|
-
end
|
253
216
|
end
|
254
217
|
end
|
255
218
|
end
|
@@ -4,7 +4,7 @@ Story: autogenerated docstrings
|
|
4
4
|
I want examples to generate their own names
|
5
5
|
So that I can reduce duplication between example names and example code
|
6
6
|
|
7
|
-
Scenario: run
|
7
|
+
Scenario: run with ruby
|
8
8
|
Given the file ../../examples/pure/autogenerated_docstrings_example.rb
|
9
9
|
|
10
10
|
When I run it with the ruby interpreter -fs
|
@@ -14,32 +14,13 @@ Story: autogenerated docstrings
|
|
14
14
|
And the stdout should match /should include "a"/
|
15
15
|
And the stdout should match /should respond to #size/
|
16
16
|
|
17
|
-
|
18
|
-
|
17
|
+
Scenario: run with spec
|
18
|
+
Given the file ../../examples/pure/autogenerated_docstrings_example.rb
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
Then the stdout should match /should equal 2/
|
23
|
-
And the stdout should match /should be > 5/
|
24
|
-
And the stdout should match /should include "b"/
|
25
|
-
And the stdout should match /should not respond to #size/
|
26
|
-
|
27
|
-
Scenario: run passing examples with spec
|
28
|
-
Given the file ../../examples/pure/autogenerated_docstrings_example.rb
|
29
|
-
|
30
|
-
When I run it with the spec script -fs
|
31
|
-
|
32
|
-
Then the stdout should match /should equal 5/
|
33
|
-
And the stdout should match /should be < 5/
|
34
|
-
And the stdout should match /should include "a"/
|
35
|
-
And the stdout should match /should respond to #size/
|
36
|
-
|
37
|
-
Scenario: run failing examples with spec
|
38
|
-
Given the file ../../failing_examples/failing_autogenerated_docstrings_example.rb
|
20
|
+
When I run it with the spec script -fs
|
39
21
|
|
40
|
-
|
22
|
+
Then the stdout should match /should equal 5/
|
23
|
+
And the stdout should match /should be < 5/
|
24
|
+
And the stdout should match /should include "a"/
|
25
|
+
And the stdout should match /should respond to #size/
|
41
26
|
|
42
|
-
Then the stdout should match /should equal 2/
|
43
|
-
And the stdout should match /should be > 5/
|
44
|
-
And the stdout should match /should include "b"/
|
45
|
-
And the stdout should match /should not respond to #size/
|
@@ -18,8 +18,3 @@ Story: Getting correct output
|
|
18
18
|
And the stdout should not match "Loaded suite"
|
19
19
|
And the stdout should not match /\d+ tests, \d+ assertions, \d+ failures, \d+ errors/m
|
20
20
|
And the stdout should match "1 example, 0 failures"
|
21
|
-
|
22
|
-
Scenario: Tweak backtrace
|
23
|
-
Given the file stories/failing_story.rb
|
24
|
-
When I run it with the ruby interpreter
|
25
|
-
Then the stdout should not match /\/lib\/spec\//
|
@@ -38,6 +38,7 @@ module Spec
|
|
38
38
|
ActionView::Base.included_modules.reverse.each do |mod|
|
39
39
|
include mod if mod.parents.include?(ActionView::Helpers)
|
40
40
|
end
|
41
|
+
ActionController::Routing::Routes.named_routes.install(self)
|
41
42
|
|
42
43
|
before(:all) do
|
43
44
|
@controller_class_name = 'Spec::Rails::Example::HelperBehaviourController'
|
@@ -8,8 +8,8 @@ module Spec
|
|
8
8
|
@expected = expected
|
9
9
|
end
|
10
10
|
|
11
|
-
def matches?(
|
12
|
-
@actual =
|
11
|
+
def matches?(response)
|
12
|
+
@actual = response.body
|
13
13
|
return actual =~ expected if Regexp === expected
|
14
14
|
return actual == expected unless Regexp === expected
|
15
15
|
end
|
@@ -83,4 +83,50 @@ require File.dirname(__FILE__) + '/../../spec_helper'
|
|
83
83
|
end.should fail_with("expected \"some_action\", got nil")
|
84
84
|
end
|
85
85
|
end
|
86
|
+
|
87
|
+
describe "response.should have_text (in #{mode} mode)",
|
88
|
+
:type => :controller do
|
89
|
+
controller_name :render_spec
|
90
|
+
if mode == 'integration'
|
91
|
+
integrate_views
|
92
|
+
end
|
93
|
+
|
94
|
+
it "should pass with exactly matching text" do
|
95
|
+
post 'text_action'
|
96
|
+
response.should have_text("this is the text for this action")
|
97
|
+
end
|
98
|
+
|
99
|
+
it "should pass with matching text (using Regexp)" do
|
100
|
+
post 'text_action'
|
101
|
+
response.should have_text(/is the text/)
|
102
|
+
end
|
103
|
+
|
104
|
+
it "should fail with matching text" do
|
105
|
+
post 'text_action'
|
106
|
+
lambda {
|
107
|
+
response.should have_text("this is NOT the text for this action")
|
108
|
+
}.should fail_with("expected \"this is NOT the text for this action\", got \"this is the text for this action\"")
|
109
|
+
end
|
110
|
+
|
111
|
+
it "should fail when a template is rendered" do
|
112
|
+
post 'some_action'
|
113
|
+
lambda {
|
114
|
+
response.should have_text("this is the text for this action")
|
115
|
+
}.should fail_with(/expected \"this is the text for this action\", got .*/)
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
describe "response.should_not have_text (in #{mode} mode)",
|
120
|
+
:type => :controller do
|
121
|
+
controller_name :render_spec
|
122
|
+
if mode == 'integration'
|
123
|
+
integrate_views
|
124
|
+
end
|
125
|
+
|
126
|
+
it "should pass with exactly matching text" do
|
127
|
+
post 'text_action'
|
128
|
+
response.should_not have_text("the accordian guy")
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
86
132
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: typo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Fr\xC3\xA9d\xC3\xA9ric de Villamil"
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2007-12-
|
12
|
+
date: 2007-12-31 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -406,6 +406,7 @@ files:
|
|
406
406
|
- app/views/xml/rsd.rxml
|
407
407
|
- bin
|
408
408
|
- bin/typo
|
409
|
+
- CHANGES-5.0
|
409
410
|
- components
|
410
411
|
- config
|
411
412
|
- config/boot.rb
|
@@ -497,6 +498,7 @@ files:
|
|
497
498
|
- db/migrate/063_rejig_state_field.rb
|
498
499
|
- db/migrate/064_add_users_profile.rb
|
499
500
|
- db/migrate/065_add_users_rights.rb
|
501
|
+
- db/migrate/066_fix_profiles.rb
|
500
502
|
- db/schema.mysql-v3.sql
|
501
503
|
- db/schema.mysql.sql
|
502
504
|
- db/schema.postgresql.sql
|
@@ -837,7 +839,6 @@ files:
|
|
837
839
|
- spec/controllers/comments_controller_spec.rb
|
838
840
|
- spec/controllers/tags_controller_spec.rb
|
839
841
|
- spec/fixtures
|
840
|
-
- spec/fixtures/articles_tags.yml
|
841
842
|
- spec/fixtures/blacklist_patterns.yml
|
842
843
|
- spec/fixtures/blogs.yml
|
843
844
|
- spec/fixtures/categories.yml
|
@@ -846,6 +847,7 @@ files:
|
|
846
847
|
- spec/fixtures/feedback.yml
|
847
848
|
- spec/fixtures/notifications.yml
|
848
849
|
- spec/fixtures/page_caches.yml
|
850
|
+
- spec/fixtures/profiles.yml
|
849
851
|
- spec/fixtures/redirects.yml
|
850
852
|
- spec/fixtures/resources.yml
|
851
853
|
- spec/fixtures/sidebars.yml
|
@@ -1501,7 +1503,6 @@ files:
|
|
1501
1503
|
- vendor/plugins/rspec/examples/stories/steps/addition_steps.rb
|
1502
1504
|
- vendor/plugins/rspec/failing_examples
|
1503
1505
|
- vendor/plugins/rspec/failing_examples/diffing_spec.rb
|
1504
|
-
- vendor/plugins/rspec/failing_examples/failing_autogenerated_docstrings_example.rb
|
1505
1506
|
- vendor/plugins/rspec/failing_examples/failure_in_setup.rb
|
1506
1507
|
- vendor/plugins/rspec/failing_examples/failure_in_teardown.rb
|
1507
1508
|
- vendor/plugins/rspec/failing_examples/mocking_example.rb
|
@@ -1841,8 +1842,6 @@ files:
|
|
1841
1842
|
- vendor/plugins/rspec/stories/resources/spec/simple_spec.rb
|
1842
1843
|
- vendor/plugins/rspec/stories/resources/steps
|
1843
1844
|
- vendor/plugins/rspec/stories/resources/steps/running_rspec.rb
|
1844
|
-
- vendor/plugins/rspec/stories/resources/stories
|
1845
|
-
- vendor/plugins/rspec/stories/resources/stories/failing_story.rb
|
1846
1845
|
- vendor/plugins/rspec/stories/resources/test
|
1847
1846
|
- vendor/plugins/rspec/stories/resources/test/spec_and_test_together.rb
|
1848
1847
|
- vendor/plugins/rspec/stories/resources/test/test_case_with_should_methods.rb
|
@@ -1976,7 +1975,6 @@ files:
|
|
1976
1975
|
- vendor/plugins/rspec_on_rails/spec/rails/matchers/assert_select_spec.rb
|
1977
1976
|
- vendor/plugins/rspec_on_rails/spec/rails/matchers/description_generation_spec.rb
|
1978
1977
|
- vendor/plugins/rspec_on_rails/spec/rails/matchers/errors_on_spec.rb
|
1979
|
-
- vendor/plugins/rspec_on_rails/spec/rails/matchers/have_text_spec.rb
|
1980
1978
|
- vendor/plugins/rspec_on_rails/spec/rails/matchers/redirect_to_spec.rb
|
1981
1979
|
- vendor/plugins/rspec_on_rails/spec/rails/matchers/render_spec.rb
|
1982
1980
|
- vendor/plugins/rspec_on_rails/spec/rails/mocks
|
@@ -1,19 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/spec_helper'
|
2
|
-
|
3
|
-
# Run spec w/ -fs to see the output of this file
|
4
|
-
|
5
|
-
describe "Failing examples with no descriptions" do
|
6
|
-
|
7
|
-
# description is auto-generated as "should equal(5)" based on the last #should
|
8
|
-
it do
|
9
|
-
3.should equal(2)
|
10
|
-
5.should equal(5)
|
11
|
-
end
|
12
|
-
|
13
|
-
it { 3.should be > 5 }
|
14
|
-
|
15
|
-
it { ["a"].should include("b") }
|
16
|
-
|
17
|
-
it { [1,2,3].should_not respond_to(:size) }
|
18
|
-
|
19
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
$:.push File.join(File.dirname(__FILE__), *%w[.. .. .. lib])
|
2
|
-
|
3
|
-
require 'spec/story'
|
4
|
-
|
5
|
-
Story "Failing story",
|
6
|
-
%(As an RSpec user
|
7
|
-
I want a failing test
|
8
|
-
So that I can observe the output) do
|
9
|
-
|
10
|
-
Scenario "Failing scenario" do
|
11
|
-
Then "true should be false" do
|
12
|
-
true.should == false
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,62 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
|
-
|
3
|
-
describe "have_text" do
|
4
|
-
|
5
|
-
describe "where target is a Regexp" do
|
6
|
-
it 'should should match submitted text using a regexp' do
|
7
|
-
string = 'foo'
|
8
|
-
string.should have_text(/fo*/)
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
describe "where target is a String" do
|
13
|
-
it 'should match submitted text using a string' do
|
14
|
-
string = 'foo'
|
15
|
-
string.should have_text('foo')
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
20
|
-
|
21
|
-
describe "have_text",
|
22
|
-
:type => :controller do
|
23
|
-
['isolation','integration'].each do |mode|
|
24
|
-
if mode == 'integration'
|
25
|
-
integrate_views
|
26
|
-
end
|
27
|
-
|
28
|
-
describe "where target is a response (in #{mode} mode)" do
|
29
|
-
controller_name :render_spec
|
30
|
-
|
31
|
-
it "should pass with exactly matching text" do
|
32
|
-
post 'text_action'
|
33
|
-
response.should have_text("this is the text for this action")
|
34
|
-
end
|
35
|
-
|
36
|
-
it "should pass with matching text (using Regexp)" do
|
37
|
-
post 'text_action'
|
38
|
-
response.should have_text(/is the text/)
|
39
|
-
end
|
40
|
-
|
41
|
-
it "should fail with matching text" do
|
42
|
-
post 'text_action'
|
43
|
-
lambda {
|
44
|
-
response.should have_text("this is NOT the text for this action")
|
45
|
-
}.should fail_with("expected \"this is NOT the text for this action\", got \"this is the text for this action\"")
|
46
|
-
end
|
47
|
-
|
48
|
-
it "should fail when a template is rendered" do
|
49
|
-
post 'some_action'
|
50
|
-
lambda {
|
51
|
-
response.should have_text("this is the text for this action")
|
52
|
-
}.should fail_with(/expected \"this is the text for this action\", got .*/)
|
53
|
-
end
|
54
|
-
|
55
|
-
it "should pass using should_not with incorrect text" do
|
56
|
-
post 'text_action'
|
57
|
-
response.should_not have_text("the accordian guy")
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|