Skip to content

Commit

Permalink
add examples in Greek
Browse files Browse the repository at this point in the history
  • Loading branch information
rousisk committed Jul 3, 2013
1 parent 20faf88 commit e77190b
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/i18n/el/.gitignore
@@ -0,0 +1 @@
features.html
6 changes: 6 additions & 0 deletions examples/i18n/el/Rakefile
@@ -0,0 +1,6 @@
$:.unshift(File.dirname(__FILE__) + '/../../../lib')
require 'cucumber/rake/task'

Cucumber::Rake::Task.new do |t|
t.cucumber_opts = %w{--format pretty}
end
17 changes: 17 additions & 0 deletions examples/i18n/el/features/addition.feature
@@ -0,0 +1,17 @@
# language: el
Δυνατότητα: Πρόσθεση
Για να αποφεύγω χαζά λάθη
Ως πρωτάρης στα μαθηματικά
Θέλω να βλέπω το άθροισμα δύο αριθμών

Περιγραφή Σεναρίου: Πρόσθεση δύο αριθμών
Δεδομένου ότι έχω εισάγει <τελεστής_1> στην αριθμομηχανή
Και έχω εισάγει <τελεστής_2> στην αριθμομηχανή
Όταν πατάω <κουμπί>
Τότε το αποτέλεσμα στην οθόνη πρέπει να είναι <αποτέλεσμα>

Παραδείγματα:
| τελεστής_1 | τελεστής_2 | κουμπί | αποτέλεσμα |
| 20 | 30 | add | 50 |
| 2 | 5 | add | 7 |
| 0 | 40 | add | 40 |
10 changes: 10 additions & 0 deletions examples/i18n/el/features/division.feature
@@ -0,0 +1,10 @@
# language: el
Δυνατότητα: Διαίρεση
Για να αποφευχθούν χαζά λάθη
Οι ταμίες θα πρέπει να μπορούν να υπολογίζουν κλάσματα

Σενάριο: Κανονικοί αριθμοί
Δεδομένου ότι έχω εισάγει 3 στην αριθμομηχανή
Και έχω εισάγει 2 στην αριθμομηχανή
Όταν πατάω divide
Τότε το αποτέλεσμα στην οθόνη πρέπει να είναι 1.5
24 changes: 24 additions & 0 deletions examples/i18n/el/features/step_definitions/calculator_steps.rb
@@ -0,0 +1,24 @@
# encoding: utf-8
begin require 'rspec/expectations'; rescue LoadError; require 'spec/expectations'; end
require 'cucumber/formatter/unicode'
$:.unshift(File.dirname(__FILE__) + '/../../lib')
require 'calculator'

Before do
@calc = Calculator.new
end

After do
end

Δεδομένου ότι /έχω εισάγει (\d+) στην αριθμομηχανή/ do |n|
@calc.push n.to_i
end

Όταν /πατάω (\w+)/ do |op|
@result = @calc.send op
end

Τότε /το αποτέλεσμα στην οθόνη πρέπει να είναι (.*)/ do |result|
@result.should == result.to_f
end
14 changes: 14 additions & 0 deletions examples/i18n/el/lib/calculator.rb
@@ -0,0 +1,14 @@
class Calculator
def push(n)
@args ||= []
@args << n
end

def add
@args.inject(0){|n,sum| sum+=n}
end

def divide
@args[0].to_f / @args[1].to_f
end
end

0 comments on commit e77190b

Please sign in to comment.