remarkable 3.1.8 → 3.1.9
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +58 -58
- data/LICENSE +20 -20
- data/README +197 -197
- data/lib/remarkable.rb +18 -18
- data/lib/remarkable/base.rb +55 -56
- data/lib/remarkable/core_ext/array.rb +19 -19
- data/lib/remarkable/dsl.rb +35 -35
- data/lib/remarkable/dsl/assertions.rb +384 -384
- data/lib/remarkable/dsl/callbacks.rb +52 -52
- data/lib/remarkable/dsl/optionals.rb +122 -122
- data/lib/remarkable/i18n.rb +53 -53
- data/lib/remarkable/macros.rb +48 -48
- data/lib/remarkable/matchers.rb +17 -17
- data/lib/remarkable/messages.rb +103 -103
- data/lib/remarkable/pending.rb +66 -66
- data/lib/remarkable/rspec.rb +24 -24
- data/lib/remarkable/version.rb +3 -3
- data/locale/en.yml +14 -14
- data/spec/base_spec.rb +41 -41
- data/spec/dsl/assertions_spec.rb +54 -54
- data/spec/dsl/optionals_spec.rb +237 -237
- data/spec/i18n_spec.rb +41 -41
- data/spec/locale/en.yml +20 -20
- data/spec/locale/pt-BR.yml +21 -21
- data/spec/macros_spec.rb +26 -26
- data/spec/matchers/be_a_person_matcher.rb +25 -25
- data/spec/matchers/collection_contain_matcher.rb +32 -32
- data/spec/matchers/contain_matcher.rb +31 -31
- data/spec/matchers/single_contain_matcher.rb +49 -49
- data/spec/matchers_spec.rb +5 -5
- data/spec/messages_spec.rb +66 -66
- data/spec/pending_spec.rb +7 -7
- data/spec/spec.opts +4 -4
- data/spec/spec_helper.rb +15 -15
- metadata +3 -3
data/spec/matchers_spec.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
-
|
3
|
-
describe Remarkable::Matchers do
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe Remarkable::Matchers do
|
4
4
|
it 'should include matchers in a specified target' do
|
5
5
|
klass = Class.new
|
6
6
|
|
@@ -46,5 +46,5 @@ describe Remarkable::Matchers do
|
|
46
46
|
klass.should_not_receive(:extend).with(Remarkable::Macros)
|
47
47
|
|
48
48
|
Remarkable.include_matchers!(Module.new, klass)
|
49
|
-
end
|
50
|
-
end
|
49
|
+
end
|
50
|
+
end
|
data/spec/messages_spec.rb
CHANGED
@@ -1,66 +1,66 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
3
|
-
|
4
|
-
describe Remarkable::Messages do
|
5
|
-
subject { [1, 2, 3] }
|
6
|
-
|
7
|
-
describe 'without I18n' do
|
8
|
-
before(:each) do
|
9
|
-
@matcher = Remarkable::Specs::Matchers::ContainMatcher.new(1, 2, 3)
|
10
|
-
end
|
11
|
-
|
12
|
-
it 'should provide a description' do
|
13
|
-
@matcher.description.should == 'contain the given values'
|
14
|
-
end
|
15
|
-
|
16
|
-
it 'should provide a failure message' do
|
17
|
-
@matcher.matches?([4])
|
18
|
-
@matcher.failure_message.should == 'Expected 1 is included in [4]'
|
19
|
-
end
|
20
|
-
|
21
|
-
it 'should provide a negative failure message' do
|
22
|
-
@matcher.matches?([1])
|
23
|
-
@matcher.negative_failure_message.should == 'Did not expect 2 is included in [1]'
|
24
|
-
end
|
25
|
-
|
26
|
-
it 'should provide a not word' do
|
27
|
-
@matcher.send(:not_word).should == 'not '
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
describe 'with I18n' do
|
32
|
-
before(:all) do
|
33
|
-
Remarkable.locale = :"pt-BR"
|
34
|
-
end
|
35
|
-
|
36
|
-
before(:each) do
|
37
|
-
@matcher = Remarkable::Specs::Matchers::CollectionContainMatcher.new(1, 2, 3)
|
38
|
-
end
|
39
|
-
|
40
|
-
it 'should provide a default i18n scope' do
|
41
|
-
@matcher.send(:matcher_i18n_scope).should == 'remarkable.specs.collection_contain'
|
42
|
-
end
|
43
|
-
|
44
|
-
it 'should provide a translated description' do
|
45
|
-
@matcher.description.should == 'conter os valores fornecidos'
|
46
|
-
end
|
47
|
-
|
48
|
-
it 'should provide a translated failure message' do
|
49
|
-
@matcher.matches?([4])
|
50
|
-
@matcher.failure_message.should == 'Esperava que 1 estivesse incluso em [4]'
|
51
|
-
end
|
52
|
-
|
53
|
-
it 'should provide a translated negative failure message' do
|
54
|
-
@matcher.matches?([1])
|
55
|
-
@matcher.negative_failure_message.should == 'Não esperava que 2 estivesse incluso em [1]'
|
56
|
-
end
|
57
|
-
|
58
|
-
it 'should provide an i18n not word' do
|
59
|
-
@matcher.send(:not_word).should == 'não '
|
60
|
-
end
|
61
|
-
|
62
|
-
after(:all) do
|
63
|
-
Remarkable.locale = :en
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
1
|
+
# encoding: utf-8
|
2
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
3
|
+
|
4
|
+
describe Remarkable::Messages do
|
5
|
+
subject { [1, 2, 3] }
|
6
|
+
|
7
|
+
describe 'without I18n' do
|
8
|
+
before(:each) do
|
9
|
+
@matcher = Remarkable::Specs::Matchers::ContainMatcher.new(1, 2, 3)
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'should provide a description' do
|
13
|
+
@matcher.description.should == 'contain the given values'
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'should provide a failure message' do
|
17
|
+
@matcher.matches?([4])
|
18
|
+
@matcher.failure_message.should == 'Expected 1 is included in [4]'
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'should provide a negative failure message' do
|
22
|
+
@matcher.matches?([1])
|
23
|
+
@matcher.negative_failure_message.should == 'Did not expect 2 is included in [1]'
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'should provide a not word' do
|
27
|
+
@matcher.send(:not_word).should == 'not '
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe 'with I18n' do
|
32
|
+
before(:all) do
|
33
|
+
Remarkable.locale = :"pt-BR"
|
34
|
+
end
|
35
|
+
|
36
|
+
before(:each) do
|
37
|
+
@matcher = Remarkable::Specs::Matchers::CollectionContainMatcher.new(1, 2, 3)
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'should provide a default i18n scope' do
|
41
|
+
@matcher.send(:matcher_i18n_scope).should == 'remarkable.specs.collection_contain'
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'should provide a translated description' do
|
45
|
+
@matcher.description.should == 'conter os valores fornecidos'
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'should provide a translated failure message' do
|
49
|
+
@matcher.matches?([4])
|
50
|
+
@matcher.failure_message.should == 'Esperava que 1 estivesse incluso em [4]'
|
51
|
+
end
|
52
|
+
|
53
|
+
it 'should provide a translated negative failure message' do
|
54
|
+
@matcher.matches?([1])
|
55
|
+
@matcher.negative_failure_message.should == 'Não esperava que 2 estivesse incluso em [1]'
|
56
|
+
end
|
57
|
+
|
58
|
+
it 'should provide an i18n not word' do
|
59
|
+
@matcher.send(:not_word).should == 'não '
|
60
|
+
end
|
61
|
+
|
62
|
+
after(:all) do
|
63
|
+
Remarkable.locale = :en
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
data/spec/pending_spec.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
-
|
3
|
-
describe Remarkable::Pending do
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe Remarkable::Pending do
|
4
4
|
|
5
5
|
it "should create pending groups" do
|
6
6
|
spec = self
|
@@ -15,7 +15,7 @@ describe Remarkable::Pending do
|
|
15
15
|
self.instance_variable_get("@_pending_group_description").should be_nil
|
16
16
|
self.instance_variable_get("@_pending_group_execute").should be_nil
|
17
17
|
end
|
18
|
-
|
18
|
+
|
19
19
|
pending "pending examples" do
|
20
20
|
# example "should show as not implemented"
|
21
21
|
#
|
@@ -28,6 +28,6 @@ describe Remarkable::Pending do
|
|
28
28
|
# end
|
29
29
|
|
30
30
|
should_contain(5)
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
data/spec/spec.opts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
--colour
|
2
|
-
--format progress
|
3
|
-
--loadby mtime
|
4
|
-
--reverse
|
1
|
+
--colour
|
2
|
+
--format progress
|
3
|
+
--loadby mtime
|
4
|
+
--reverse
|
data/spec/spec_helper.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
$TESTING=true
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
|
5
|
-
dir = File.dirname(__FILE__)
|
6
|
-
require File.join(dir, '..', 'lib', 'remarkable')
|
7
|
-
|
8
|
-
Dir[File.join(dir, 'matchers', '*.rb')].each do |file|
|
9
|
-
require file
|
10
|
-
end
|
11
|
-
|
12
|
-
Remarkable.include_matchers!(Remarkable::Specs, Spec::Example::ExampleGroup)
|
13
|
-
|
14
|
-
Remarkable.add_locale File.join(dir, 'locale', 'en.yml')
|
15
|
-
Remarkable.add_locale File.join(dir, 'locale', 'pt-BR.yml')
|
1
|
+
$TESTING=true
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
|
5
|
+
dir = File.dirname(__FILE__)
|
6
|
+
require File.join(dir, '..', 'lib', 'remarkable')
|
7
|
+
|
8
|
+
Dir[File.join(dir, 'matchers', '*.rb')].each do |file|
|
9
|
+
require file
|
10
|
+
end
|
11
|
+
|
12
|
+
Remarkable.include_matchers!(Remarkable::Specs, Spec::Example::ExampleGroup)
|
13
|
+
|
14
|
+
Remarkable.add_locale File.join(dir, 'locale', 'en.yml')
|
15
|
+
Remarkable.add_locale File.join(dir, 'locale', 'pt-BR.yml')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remarkable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carlos Brando
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-
|
13
|
+
date: 2009-08-30 00:00:00 +02:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -79,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
79
|
requirements: []
|
80
80
|
|
81
81
|
rubyforge_project: remarkable
|
82
|
-
rubygems_version: 1.3.
|
82
|
+
rubygems_version: 1.3.5
|
83
83
|
signing_key:
|
84
84
|
specification_version: 3
|
85
85
|
summary: "Remarkable: a framework for rspec matchers, with support to macros and I18n."
|