rspec-i18n 1.1.0 → 1.2.0
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/.gitignore +2 -0
- data/Gemfile +6 -0
- data/History.rdoc +40 -2
- data/License.txt +0 -1
- data/README.rdoc +19 -19
- data/Rakefile +54 -4
- data/TODO.txt +5 -24
- data/Tasks +3 -0
- data/VERSION.yml +3 -3
- data/bin/rspec-i18n +4 -13
- data/cucumber.yml +1 -0
- data/examples/i18n/de/german_spec.rb +39 -0
- data/examples/i18n/pt/{person_spec.rb → portuguese_spec.rb} +39 -7
- data/features/command_line/list_languages.feature +113 -0
- data/features/support/env.rb +13 -0
- data/lib/spec-i18n/command_line/language_help_formatter.rb +64 -58
- data/lib/spec-i18n/command_line/main.rb +1 -6
- data/lib/spec-i18n/command_line/options.rb +31 -17
- data/lib/spec-i18n/dsl/main.rb +23 -4
- data/lib/spec-i18n/example.rb +1 -0
- data/lib/spec-i18n/example/before_and_after_hooks.rb +26 -8
- data/lib/spec-i18n/example/example_group_methods.rb +9 -6
- data/lib/spec-i18n/example/pending.rb +19 -0
- data/lib/spec-i18n/example/subject.rb +2 -4
- data/lib/spec-i18n/expectations/extensions/kernel.rb +6 -4
- data/lib/spec-i18n/languages.yml +88 -50
- data/lib/spec-i18n/matchers.rb +0 -2
- data/lib/spec-i18n/matchers/be.rb +36 -49
- data/lib/spec-i18n/matchers/method_missing.rb +33 -17
- data/lib/spec-i18n/matchers/register_all_matchers.rb +1 -2
- data/lib/spec-i18n/matchers/translate_basic_matchers.rb +40 -14
- data/lib/spec-i18n/parser/natural_language.rb +228 -27
- data/lib/spec-i18n/platform.rb +0 -2
- data/lib/spec-i18n/runner/configuration.rb +64 -6
- data/lib/spec-i18n/spec_language.rb +29 -2
- data/rspec-i18n.gemspec +30 -20
- data/spec/spec-i18n/command_line/language_help_formatter_spec.rb +74 -49
- data/spec/spec-i18n/command_line/options_spec.rb +11 -2
- data/spec/spec-i18n/dsl/main_spec.rb +54 -12
- data/spec/spec-i18n/example/before_and_after_hooks_spec.rb +210 -88
- data/spec/spec-i18n/example/example_group_methods_spec.rb +26 -8
- data/spec/spec-i18n/example/pending_spec.rb +41 -0
- data/spec/spec-i18n/example/subject_spec.rb +27 -41
- data/spec/spec-i18n/expectations/kernel_spec.rb +29 -15
- data/spec/spec-i18n/matchers/be_close_spec.rb +7 -5
- data/spec/spec-i18n/matchers/be_instance_of_spec.rb +4 -5
- data/spec/spec-i18n/matchers/be_kind_of_spec.rb +3 -6
- data/spec/spec-i18n/matchers/be_spec.rb +255 -89
- data/spec/spec-i18n/matchers/eql_spec.rb +4 -6
- data/spec/spec-i18n/matchers/equal_spec.rb +28 -7
- data/spec/spec-i18n/matchers/exist_spec.rb +4 -5
- data/spec/spec-i18n/matchers/have_spec.rb +1 -1
- data/spec/spec-i18n/matchers/include_spec.rb +6 -8
- data/spec/spec-i18n/matchers/match_spec.rb +4 -5
- data/spec/spec-i18n/matchers/raise_error_spec.rb +5 -4
- data/spec/spec-i18n/matchers/satisfy_spec.rb +4 -5
- data/spec/spec-i18n/parser/natural_language_spec.rb +420 -58
- data/spec/spec-i18n/runner/{runner_spec.rb → rspec_i18n_language_spec.rb} +0 -0
- data/spec/spec-i18n/runner/{configuration_spec.rb → rspec_i18n_spec.rb} +28 -7
- data/spec/spec-i18n/spec_examples/pt/pessoa_spec.rb +63 -5
- data/spec/spec-i18n/spec_language_spec.rb +24 -10
- data/spec/spec.opts +1 -2
- data/spec/spec_helper.rb +26 -18
- metadata +102 -44
data/.gitignore
CHANGED
data/Gemfile
ADDED
data/History.rdoc
CHANGED
@@ -1,8 +1,46 @@
|
|
1
|
-
|
1
|
+
=== development
|
2
|
+
|
3
|
+
* enhancements
|
4
|
+
* Create the directory features to test with Cucumber
|
5
|
+
* List all the matchers and hooks in Command Line
|
6
|
+
* Refactoring Language Help Formatter and Command Line
|
7
|
+
* Simplified more and more all the specs!
|
8
|
+
* Support Ruby 1.9.1 and 1.9.2 > preview1 ! =]
|
9
|
+
* Translated shared examples(translated: shared_examples_for, share_as, it_should_behave_like)
|
10
|
+
* Translated the pending keyword
|
11
|
+
* Put Comments in the methods(For future Rspec-i18n rdoc)
|
12
|
+
* Make the describe/it i18n available from a class:
|
13
|
+
Example:
|
14
|
+
#
|
15
|
+
# Spec::Runner.configure do |config|
|
16
|
+
# config.spec_language :pt
|
17
|
+
# end
|
18
|
+
#
|
19
|
+
# class PilhaSpec < Spec::ExampleGroup
|
20
|
+
# descreva Pilha, "sem nenhum elemento" do
|
21
|
+
#
|
22
|
+
# antes do
|
23
|
+
# @pilha = Pilha.new
|
24
|
+
# end
|
25
|
+
#
|
26
|
+
# exemplo "deve lançar um erro no momento do pop" do
|
27
|
+
# lambda { @pilha.pop }.deve mostrar_erro
|
28
|
+
# end
|
29
|
+
# end
|
30
|
+
# end
|
31
|
+
|
32
|
+
* bugfix
|
33
|
+
* Fix Parser in Command Line - Thanks to Julio Protzek
|
34
|
+
* Fix ANSIColor Conflict with Active Record
|
35
|
+
|
36
|
+
==== Version 1.1.0
|
2
37
|
|
3
38
|
* enhancements
|
4
39
|
* Refactored internal code and specs
|
5
|
-
* Translate
|
40
|
+
* Translate be_nil
|
41
|
+
* Translate be_true
|
42
|
+
* Translate be_false
|
43
|
+
* Translate be_empty.
|
6
44
|
|
7
45
|
=== Version 1.0.0
|
8
46
|
|
data/License.txt
CHANGED
data/README.rdoc
CHANGED
@@ -3,27 +3,24 @@
|
|
3
3
|
* http://github.com/tomas-stefano/rspec-i18n/wikis
|
4
4
|
* http://gemcutter.org/gems/rspec-i18n
|
5
5
|
* http://rspec-i18n.lighthouseapp.com
|
6
|
+
* http://tomas-stefano.github.com/rspec-i18n
|
6
7
|
|
7
8
|
== Install
|
8
9
|
|
9
10
|
[sudo] gem install rspec-i18n
|
10
11
|
|
11
|
-
Or if you use rvm(for example ruby 1.8.7):
|
12
|
-
|
13
|
-
rvm 1.8.7 gem install rspec-i18n
|
14
|
-
|
15
12
|
== Description
|
16
13
|
|
17
14
|
The Rspec-i18n gem provide a easy way to write specs in any speaking language you
|
18
15
|
prefer - If don't have your speaking language, please make a fork =)
|
19
16
|
The Rspec-i18n was created for the purpose of teaching people who are
|
20
17
|
starting to developing applications but also serves to Production use.
|
21
|
-
I know that many people prefer to write
|
22
|
-
But if you don't prefer that
|
18
|
+
I know that many people prefer to write <b>Specs</b> in English.
|
19
|
+
But if you don't prefer that or in SOME cases <b>DON'T NEED THAT</b>, you'll like the Rspec-i18n. =)
|
23
20
|
|
24
21
|
== Synopsis
|
25
22
|
|
26
|
-
Rspec-i18n
|
23
|
+
Rspec-i18n Will support various languages(If don't have your speaking language, please make a fork and send pull requests!)
|
27
24
|
(See http://github.com/tomas-stefano/rspec-i18n/blob/master/lib/spec-i18n/languages.yml file).
|
28
25
|
Here is a simple example of Portuguese(Brazil):
|
29
26
|
|
@@ -52,7 +49,7 @@ Start with a very very simple example in Portuguese:
|
|
52
49
|
|
53
50
|
antes(:de_cada) do
|
54
51
|
@homer = Personagem.new("Homer Simpson", :desenho => :simpson)
|
55
|
-
|
52
|
+
@meggie = Personagem.new("Meggie Simpson", :desenho => :simpson)
|
56
53
|
end
|
57
54
|
|
58
55
|
isto "deve retornar o desenho ao qual o personagem pertence" do
|
@@ -67,8 +64,16 @@ Start with a very very simple example in Portuguese:
|
|
67
64
|
@homer.bebe_cerveja_duffy?.deve ser_verdadeiro
|
68
65
|
end
|
69
66
|
|
70
|
-
isto "deve beber cerveja Duffy" do
|
71
|
-
@meggie.bebe_cerveja_duffy?.
|
67
|
+
isto "não deve beber cerveja Duffy" do
|
68
|
+
@meggie.bebe_cerveja_duffy?.nao_deve ser_verdadeiro
|
69
|
+
end
|
70
|
+
|
71
|
+
isto "deve ser menor de idade" do
|
72
|
+
@meggie.maior_de_idade?.deve ser_falso
|
73
|
+
end
|
74
|
+
|
75
|
+
isto "deve ser nulo" do
|
76
|
+
@margie.deve ser_nulo
|
72
77
|
end
|
73
78
|
|
74
79
|
end
|
@@ -84,20 +89,15 @@ See more examples in http://github.com/tomas-stefano/rspec-i18n/blob/master/exam
|
|
84
89
|
== Listing the available keywords for the language
|
85
90
|
|
86
91
|
rspec-i18n --language pt
|
87
|
-
|
88
|
-
rspec-i18n --language es
|
89
92
|
|
90
|
-
==
|
93
|
+
== Collaborating with Rspec-I18n
|
91
94
|
|
92
|
-
|
93
|
-
2. Add your language keywords to languages.yml
|
94
|
-
3. Commit and push your changes - then send a pull request at Github
|
95
|
+
- See <b> http://wiki.github.com/tomas-stefano/rspec-i18n/collaborating-with-rspec-i18n </b>
|
95
96
|
|
96
|
-
|
97
|
+
== Supported Versions
|
97
98
|
|
98
|
-
|
99
|
+
<b>ONLY Ruby 1.8 (The Edge Version Supports Ruby 1.9!)</b>
|
99
100
|
|
100
|
-
<b>ONLY Ruby 1.8</b>
|
101
101
|
<b>Rspec-i18n >= 1.0.0</b> supports <b>ONLY Rspec 1.3</b>
|
102
102
|
|
103
103
|
The older versions supports this versions: Rspec: 1.2.7, 1.2.8, 1.2.9
|
data/Rakefile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
require 'rubygems'
|
3
3
|
require 'rake'
|
4
|
-
require
|
4
|
+
require "./lib/spec-i18n/platform"
|
5
5
|
|
6
6
|
$:.unshift(File.dirname(__FILE__) + '/lib')
|
7
7
|
|
@@ -31,11 +31,11 @@ begin
|
|
31
31
|
|
32
32
|
gemspec.add_dependency('rspec', '>= 1.3.0')
|
33
33
|
gemspec.add_dependency('terminal-table', '>= 1.4.2')
|
34
|
-
gemspec.add_dependency('term-ansicolor', '1.0.4')
|
35
34
|
|
36
|
-
gemspec.add_development_dependency('rspec', '>= 1.
|
35
|
+
gemspec.add_development_dependency('rspec', '>= 1.3.0')
|
36
|
+
gemspec.add_development_dependency('cucumber', '>= 0.6.2')
|
37
37
|
gemspec.add_development_dependency('terminal-table', '>= 1.4.2')
|
38
|
-
gemspec.add_development_dependency('
|
38
|
+
gemspec.add_development_dependency('aruba', '>= 0.1.7')
|
39
39
|
|
40
40
|
gemspec.post_install_message = POST_MESSAGE
|
41
41
|
end
|
@@ -46,3 +46,53 @@ rescue LoadError
|
|
46
46
|
[sudo] gem install jeweler"
|
47
47
|
puts("-" * 80)
|
48
48
|
end
|
49
|
+
|
50
|
+
INTEGRATION_TASKS = %w(
|
51
|
+
spec_all_ruby_versions
|
52
|
+
rcov
|
53
|
+
verify_rcov
|
54
|
+
git:push
|
55
|
+
remove_logs
|
56
|
+
)
|
57
|
+
|
58
|
+
task :spec_all_ruby_versions do
|
59
|
+
sh("rvm 1.8.7-p249,1.9.1,1.9.2-preview1 specs")
|
60
|
+
puts
|
61
|
+
end
|
62
|
+
|
63
|
+
namespace :git do
|
64
|
+
task :push do
|
65
|
+
`git push origin master`
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
task :integrate do
|
70
|
+
INTEGRATION_TASKS.each do |integrate_task|
|
71
|
+
puts("-" * 80)
|
72
|
+
Rake::Task[integrate_task].invoke
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
# I don't wanna use the Spec::Rake::SpecTask
|
77
|
+
#
|
78
|
+
task :rspec do
|
79
|
+
sh('spec spec --diff --color')
|
80
|
+
end
|
81
|
+
|
82
|
+
task :remove_logs do
|
83
|
+
sh('rm -rf logs') # Be careful!!! =]
|
84
|
+
sh('rm -rf log')
|
85
|
+
end
|
86
|
+
|
87
|
+
require 'spec/rake/spectask'
|
88
|
+
|
89
|
+
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
90
|
+
spec.libs << 'lib' << 'spec'
|
91
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
92
|
+
spec.rcov = true
|
93
|
+
spec.rcov_opts = ['--exclude', "_spec,gems,spec_helper.rb"]
|
94
|
+
end
|
95
|
+
|
96
|
+
require 'spec/rake/verify_rcov'
|
97
|
+
RCov::VerifyTask.new(:verify_rcov) { |t| t.threshold = 100.0 }
|
98
|
+
|
data/TODO.txt
CHANGED
@@ -1,30 +1,11 @@
|
|
1
1
|
== Refactoring
|
2
2
|
|
3
|
-
* Simplified more and more tests!
|
4
|
-
* Find the right module for the example group specs(it/example) (I think =>
|
5
|
-
Spec::Example::ExampleGroupMethods but I think I was wrong)
|
6
3
|
* Need better hints for the 'its' word
|
7
4
|
|
8
5
|
== Future
|
9
6
|
|
10
|
-
*
|
11
|
-
*
|
12
|
-
*
|
13
|
-
*
|
14
|
-
|
15
|
-
Example:
|
16
|
-
# class PilhaSpec < Spec::ExampleGroup
|
17
|
-
# descreva Pilha, "sem nenhum elemento"
|
18
|
-
#
|
19
|
-
# antes do
|
20
|
-
# @pilha = Pilha.new
|
21
|
-
# end
|
22
|
-
#
|
23
|
-
# exemplo "deve lançar um erro no momento do pop" do
|
24
|
-
# lambda { @pilha.pop }.deve mostrar_erro
|
25
|
-
# end
|
26
|
-
#
|
27
|
-
# end
|
28
|
-
|
29
|
-
* Check a better way to manipulating the mocks and stubs (What do you think?)
|
30
|
-
* Verify the following matchers: simple_matcher, wrap_expectation, respond_to, change and match_unless_raises.
|
7
|
+
* Support Rspec 2.0!
|
8
|
+
* Verifying if it's possible to translate error and success messages,documentation and output feedback
|
9
|
+
* Change the order of predicates and verbs and objects for other languages
|
10
|
+
* Check a better way to manipulating the mocks and stubs (need think more about that)
|
11
|
+
* Verify the following matchers: simple_matcher, wrap_expectation, respond_to, change and match_unless_raises.
|
data/Tasks
ADDED
data/VERSION.yml
CHANGED
data/bin/rspec-i18n
CHANGED
@@ -1,18 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
rspec_i18n_dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
|
3
2
|
|
4
|
-
|
3
|
+
rspec_dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
|
4
|
+
$LOAD_PATH.unshift(rspec_dir) unless $LOAD_PATH.include?(rspec_dir)
|
5
5
|
|
6
|
-
require '
|
6
|
+
require 'optparse'
|
7
7
|
require 'spec-i18n/command_line/main'
|
8
8
|
|
9
|
-
|
10
|
-
begin
|
11
|
-
SpecI18n::CommandLine::Main.execute(ARGV.dup)
|
12
|
-
rescue SystemExit => e
|
13
|
-
Kernel.exit(e.status)
|
14
|
-
rescue Exception => e
|
15
|
-
STDERR.puts("#{e.message} (#{e.class})")
|
16
|
-
STDERR.puts(e.backtrace.join("\n"))
|
17
|
-
Kernel.exit(1)
|
18
|
-
end
|
9
|
+
SpecI18n::CommandLine::Main.execute(ARGV)
|
data/cucumber.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
default: features --format progress
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# coding: UTF-8
|
2
|
+
require 'lib/spec-i18n'
|
3
|
+
|
4
|
+
Spec::Runner.configure do |config|
|
5
|
+
config.spec_language :de
|
6
|
+
end
|
7
|
+
|
8
|
+
class Person
|
9
|
+
end
|
10
|
+
|
11
|
+
# PLEASE - Replace with GOOD EXAMPLES
|
12
|
+
#
|
13
|
+
beschreibe Person do
|
14
|
+
|
15
|
+
vorher(:von_jeder) do
|
16
|
+
@vorher = 'Before Keyword!'
|
17
|
+
end
|
18
|
+
|
19
|
+
es 'wahr sollte wahr sein' do
|
20
|
+
true.sollte wahr_sein
|
21
|
+
end
|
22
|
+
|
23
|
+
es 'falsch sollte falsch sein' do
|
24
|
+
false.sollte falsch_sein
|
25
|
+
end
|
26
|
+
|
27
|
+
es '@vorher sollte nicht null sein' do
|
28
|
+
@vorher.sollte_nicht null_sein
|
29
|
+
end
|
30
|
+
|
31
|
+
es 'leer sollte leer sein' do
|
32
|
+
[].sollte leer_sein
|
33
|
+
end
|
34
|
+
|
35
|
+
es 'nicht leer sollte nicht leer sein' do
|
36
|
+
[1].sollte_nicht leer_sein
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
@@ -1,12 +1,12 @@
|
|
1
|
-
|
2
|
-
require 'spec-i18n'
|
1
|
+
# coding: UTF-8
|
2
|
+
require 'lib/spec-i18n'
|
3
3
|
|
4
4
|
Spec::Runner.configure do |config|
|
5
5
|
config.spec_language :pt
|
6
6
|
end
|
7
7
|
|
8
8
|
class Pessoa
|
9
|
-
attr_accessor :idade
|
9
|
+
attr_accessor :idade, :nome
|
10
10
|
def initialize(nome, sobrenome, opcoes={})
|
11
11
|
@nome = nome
|
12
12
|
@sobrenome = sobrenome
|
@@ -14,6 +14,14 @@ class Pessoa
|
|
14
14
|
@filhos = opcoes[:filhos]
|
15
15
|
end
|
16
16
|
|
17
|
+
def nome
|
18
|
+
@nome.downcase.to_sym
|
19
|
+
end
|
20
|
+
|
21
|
+
def exist?
|
22
|
+
true unless self.nil?
|
23
|
+
end
|
24
|
+
|
17
25
|
def nome_completo
|
18
26
|
"#{@nome} #{@sobrenome}"
|
19
27
|
end
|
@@ -76,14 +84,26 @@ descreva Pessoa do
|
|
76
84
|
isto 'deve ser uma instancia da classe Pessoa' do
|
77
85
|
@pessoa.deve ser_instancia_de(Pessoa)
|
78
86
|
end
|
87
|
+
|
88
|
+
especificar 'deve existir' do
|
89
|
+
@pessoa.deve existir
|
90
|
+
end
|
79
91
|
|
80
|
-
|
92
|
+
especificar 'deve incluir uma pessoa' do
|
81
93
|
@pessoas.deve incluir(@pessoa)
|
82
94
|
end
|
83
95
|
|
84
|
-
|
96
|
+
especificar 'deve ser do tipo Pessoa' do
|
85
97
|
@pessoa.deve ser_do_tipo(Pessoa)
|
86
98
|
end
|
99
|
+
|
100
|
+
isto 'deve lançar uma excessão' do
|
101
|
+
lambda { @pessoa.isso_nao_existe }.deve mostrar_excessao
|
102
|
+
end
|
103
|
+
|
104
|
+
isto 'deve satisfazer a condicao de maior de idade' do
|
105
|
+
@pessoa.deve satisfazer { |pessoa| pessoa == @pessoa}
|
106
|
+
end
|
87
107
|
|
88
108
|
isto 'deve ter pelo menos uma pessoa' do
|
89
109
|
@pessoas.deve ter_no_minimo(1).items
|
@@ -99,6 +119,14 @@ descreva Pessoa do
|
|
99
119
|
@pessoas.deve ter_no_maximo(3).items
|
100
120
|
end
|
101
121
|
|
122
|
+
contexto 'Pronto para Se Casar' do
|
123
|
+
|
124
|
+
isto 'deve estar pendente' do
|
125
|
+
pendente
|
126
|
+
end
|
127
|
+
|
128
|
+
end
|
129
|
+
|
102
130
|
contexto "Nome completo" do
|
103
131
|
|
104
132
|
antes(:de_cada_exemplo) do
|
@@ -109,8 +137,12 @@ descreva Pessoa do
|
|
109
137
|
@pessoa.nome_completo.deve ==("Tomás D'Stefano")
|
110
138
|
end
|
111
139
|
|
112
|
-
isto 'nome completo
|
113
|
-
@pessoa.
|
140
|
+
isto 'deve retornar nome completo em simbolo' do
|
141
|
+
@pessoa.nome.deve ser_igual_a(:tomás)
|
142
|
+
end
|
143
|
+
|
144
|
+
isto 'nome completo nao pode ser nulo' do
|
145
|
+
@pessoa.nome_completo.nao_deve ser_nulo
|
114
146
|
end
|
115
147
|
|
116
148
|
end
|
@@ -0,0 +1,113 @@
|
|
1
|
+
Feature: Rspec-i18n all the languages executable
|
2
|
+
In order to read the translated keywords
|
3
|
+
As an Rspec-i18n user
|
4
|
+
I want to run the rspec-i18n executable to see all the languages
|
5
|
+
|
6
|
+
Scenario: See the headers in list languages
|
7
|
+
When I run "rspec-i18n -l help"
|
8
|
+
Then I should see "Language"
|
9
|
+
And I should see "Name"
|
10
|
+
And I should see "Native"
|
11
|
+
|
12
|
+
Scenario: See the values of all language
|
13
|
+
When I run "rspec-i18n -l help"
|
14
|
+
Then I should see "German"
|
15
|
+
And I should see "Deutsch"
|
16
|
+
And I should see "Portuguese"
|
17
|
+
And I should see "Korean"
|
18
|
+
|
19
|
+
Scenario: See the language keywords and translations in ruby 1.8.7-p249
|
20
|
+
Given I am using rvm "1.8.7-p249"
|
21
|
+
When I run "rspec-i18n --language pt"
|
22
|
+
Then I should see:
|
23
|
+
"""
|
24
|
+
+-----------------------+---------------------------------------------+
|
25
|
+
| Rspec Keywords | Translated Keyword |
|
26
|
+
+-----------------------+---------------------------------------------+
|
27
|
+
| after | depois |
|
28
|
+
| before | antes |
|
29
|
+
| describe | descreva / contexto |
|
30
|
+
| it | isso / isto / especificar / exemplo |
|
31
|
+
| it_should_behave_like | deve_se_comportar_como |
|
32
|
+
| its | exemplo_do_assunto |
|
33
|
+
| name | Portuguese |
|
34
|
+
| native | Português |
|
35
|
+
| pending | pendente |
|
36
|
+
| share_as | distribua_como |
|
37
|
+
| shared_examples_for | exemplos_distribuidos / exemplo_distribuido |
|
38
|
+
| should | deve |
|
39
|
+
| should_not | nao_deve |
|
40
|
+
| subject | assunto |
|
41
|
+
+-----------------------+---------------------------------------------+
|
42
|
+
"""
|
43
|
+
|
44
|
+
Scenario: See the language keywords and translations in ruby 1.9.1
|
45
|
+
Given I am using rvm "1.9.1"
|
46
|
+
When I run "rspec-i18n --language pt"
|
47
|
+
Then I should see:
|
48
|
+
"""
|
49
|
+
+-----------------------+---------------------------------------------+
|
50
|
+
| Rspec Keywords | Translated Keyword |
|
51
|
+
+-----------------------+---------------------------------------------+
|
52
|
+
| after | depois |
|
53
|
+
| before | antes |
|
54
|
+
| describe | descreva / contexto |
|
55
|
+
| it | isso / isto / especificar / exemplo |
|
56
|
+
| it_should_behave_like | deve_se_comportar_como |
|
57
|
+
| its | exemplo_do_assunto |
|
58
|
+
| name | Portuguese |
|
59
|
+
| native | Português |
|
60
|
+
| pending | pendente |
|
61
|
+
| share_as | distribua_como |
|
62
|
+
| shared_examples_for | exemplos_distribuidos / exemplo_distribuido |
|
63
|
+
| should | deve |
|
64
|
+
| should_not | nao_deve |
|
65
|
+
| subject | assunto |
|
66
|
+
+-----------------------+---------------------------------------------+
|
67
|
+
"""
|
68
|
+
|
69
|
+
Scenario: See the all the Matchers of a one language
|
70
|
+
When I run "rspec-i18n --language pt"
|
71
|
+
Then I should see:
|
72
|
+
"""
|
73
|
+
+-------------------+---------------------------------+
|
74
|
+
| Rspec Matchers | Translated Keyword |
|
75
|
+
+-------------------+---------------------------------+
|
76
|
+
| be | ser / estar |
|
77
|
+
| be_a_kind_of | ser_do_tipo |
|
78
|
+
| be_an_instance_of | ser_instancia_de |
|
79
|
+
| be_close | estar_perto / estar_proximo |
|
80
|
+
| empty_word | vazio |
|
81
|
+
| eql | igl |
|
82
|
+
| equal | igual / igual_a |
|
83
|
+
| exist | existir |
|
84
|
+
| false_word | falso |
|
85
|
+
| have | ter |
|
86
|
+
| have_at_least | ter_no_minimo |
|
87
|
+
| have_at_most | ter_no_maximo |
|
88
|
+
| have_exactly | ter_exatamente |
|
89
|
+
| include | incluir |
|
90
|
+
| match | corresponder |
|
91
|
+
| nil_word | nulo |
|
92
|
+
| raise_error | mostrar_erro / mostrar_excessao |
|
93
|
+
| satisfy | satisfazer |
|
94
|
+
| true_word | verdadeiro |
|
95
|
+
+-------------------+---------------------------------+
|
96
|
+
"""
|
97
|
+
|
98
|
+
Scenario: See al the hooks of a one language
|
99
|
+
Given I am using rvm "1.8.7-p249"
|
100
|
+
When I run "rspec-i18n --language pt"
|
101
|
+
Then I should see:
|
102
|
+
"""
|
103
|
+
+----------------+------------------------------------------------+
|
104
|
+
| Rspec Hooks | Translated Keyword |
|
105
|
+
+----------------+------------------------------------------------+
|
106
|
+
| before(:all) | antes(:de_todos) / antes(:de_todos_exemplos) |
|
107
|
+
| after(:all) | depois(:de_todos) / depois(:de_todos_exemplos) |
|
108
|
+
| before(:each) | antes(:de_cada) / antes(:de_cada_exemplo) |
|
109
|
+
| after(:each) | depois(:de_cada) / depois(:de_cada_exemplo) |
|
110
|
+
| before(:suite) | antes(:suite) |
|
111
|
+
| after(:suite) | depois(:suite) |
|
112
|
+
+----------------+------------------------------------------------+
|
113
|
+
"""
|