cucumber 0.4.2 → 0.4.3
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/History.txt +30 -4
- data/Rakefile +11 -8
- data/VERSION.yml +1 -1
- data/bin/cucumber +1 -2
- data/cucumber.gemspec +40 -38
- data/examples/i18n/da/features/{summering.feature → sammenlaegning.feature} +5 -5
- data/examples/i18n/da/features/step_definitons/{kalkulator_steps.rb → lommeregner_steps.rb} +3 -3
- data/examples/i18n/da/lib/{kalkulator.rb → lommeregner.rb} +2 -2
- data/examples/tickets/Rakefile +5 -1
- data/examples/tickets/features.html +138 -0
- data/examples/watir/Rakefile +4 -0
- data/examples/watir/features/{step_definitons → step_definitions}/search_steps.rb +0 -0
- data/examples/watir/features/support/screenshots.rb +45 -0
- data/features/announce.feature +122 -0
- data/features/html_formatter/a.html +1 -1
- data/features/step_definitions/cucumber_steps.rb +1 -1
- data/features/step_definitions/wire_steps.rb +14 -0
- data/features/support/env.rb +1 -1
- data/features/support/fake_wire_server.rb +63 -0
- data/features/tag_logic.feature +226 -0
- data/features/wire_protocol.feature +177 -0
- data/lib/cucumber/ast/examples.rb +4 -0
- data/lib/cucumber/ast/feature_element.rb +2 -1
- data/lib/cucumber/ast/scenario_outline.rb +4 -0
- data/lib/cucumber/ast/table.rb +13 -8
- data/lib/cucumber/ast/tags.rb +56 -12
- data/lib/cucumber/ast/tree_walker.rb +6 -0
- data/lib/cucumber/cli/main.rb +7 -5
- data/lib/cucumber/cli/options.rb +19 -10
- data/lib/cucumber/filter.rb +1 -2
- data/lib/cucumber/formatter/ansicolor.rb +17 -2
- data/lib/cucumber/formatter/console.rb +50 -32
- data/lib/cucumber/formatter/html.rb +21 -1
- data/lib/cucumber/formatter/junit.rb +8 -0
- data/lib/cucumber/formatter/pretty.rb +3 -0
- data/lib/cucumber/formatter/summary.rb +35 -0
- data/lib/cucumber/formatter/usage.rb +4 -4
- data/lib/cucumber/rails/active_record.rb +18 -10
- data/lib/cucumber/rb_support/rb_language.rb +7 -2
- data/lib/cucumber/rb_support/rb_world.rb +4 -0
- data/lib/cucumber/step_match.rb +3 -2
- data/lib/cucumber/step_mother.rb +6 -1
- data/lib/cucumber/wire_support/connection.rb +42 -0
- data/lib/cucumber/wire_support/request_handler.rb +19 -0
- data/lib/cucumber/wire_support/wire_exception.rb +10 -0
- data/lib/cucumber/wire_support/wire_language.rb +52 -0
- data/lib/cucumber/wire_support/wire_packet.rb +34 -0
- data/lib/cucumber/wire_support/wire_protocol.rb +64 -0
- data/lib/cucumber/wire_support/wire_step_definition.rb +21 -0
- data/rails_generators/cucumber/cucumber_generator.rb +7 -4
- data/rails_generators/cucumber/templates/cucumber_environment.rb +4 -4
- data/rails_generators/cucumber/templates/version_check.rb +6 -4
- data/spec/cucumber/ast/table_spec.rb +11 -1
- data/spec/cucumber/ast/tags_spec.rb +29 -0
- data/spec/cucumber/cli/options_spec.rb +8 -4
- data/spec/cucumber/formatter/junit_spec.rb +11 -0
- data/spec/cucumber/step_match_spec.rb +11 -0
- data/spec/cucumber/wire_support/wire_language_spec.rb +47 -0
- data/spec/cucumber/wire_support/wire_packet_spec.rb +26 -0
- metadata +38 -36
- data/examples/cs/.gitignore +0 -1
- data/examples/cs/README.textile +0 -1
- data/examples/cs/Rakefile +0 -12
- data/examples/cs/compile.bat +0 -1
- data/examples/cs/features/addition.feature +0 -16
- data/examples/cs/features/step_definitons/calculator_steps.rb +0 -19
- data/examples/cs/src/demo/Calculator.cs +0 -20
- data/examples/java/.gitignore +0 -1
- data/examples/java/README.textile +0 -18
- data/examples/java/build.xml +0 -33
- data/examples/java/features/hello.feature +0 -11
- data/examples/java/features/step_definitons/hello_steps.rb +0 -23
- data/examples/java/features/step_definitons/tree_steps.rb +0 -14
- data/examples/java/features/tree.feature +0 -9
- data/examples/java/src/.gitignore +0 -1
- data/examples/java/src/cucumber/demo/.gitignore +0 -1
- data/examples/java/src/cucumber/demo/Hello.java +0 -16
- data/examples/pure_java/README.textile +0 -5
@@ -0,0 +1,47 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
+
require 'cucumber/wire_support/wire_language'
|
3
|
+
|
4
|
+
module Cucumber
|
5
|
+
module WireSupport
|
6
|
+
describe WireLanguage do
|
7
|
+
def stub_wire_file!(filename, config)
|
8
|
+
YAML.should_receive(:load_file).with(filename).and_return config
|
9
|
+
end
|
10
|
+
|
11
|
+
describe "#load_code_file" do
|
12
|
+
before(:each) do
|
13
|
+
stub_wire_file! 'foo.wire', :config
|
14
|
+
end
|
15
|
+
|
16
|
+
it "creates a RemoteSteps object" do
|
17
|
+
Connection.should_receive(:new).with(:config)
|
18
|
+
WireLanguage.new(nil).load_code_file('foo.wire')
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
describe "#step_matches" do
|
23
|
+
def stub_remote_steps!(config, attributes)
|
24
|
+
Connection.should_receive(:new).
|
25
|
+
with(config).
|
26
|
+
and_return( mock('remote_steps', attributes) )
|
27
|
+
end
|
28
|
+
|
29
|
+
before(:each) do
|
30
|
+
stub_wire_file! 'one.wire', :config_one
|
31
|
+
stub_wire_file! 'two.wire', :config_two
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should return the matches from each of the RemoteSteps" do
|
35
|
+
stub_remote_steps! :config_one, :step_matches => [:a, :b]
|
36
|
+
stub_remote_steps! :config_two, :step_matches => [:c]
|
37
|
+
|
38
|
+
wire_language = WireLanguage.new(nil)
|
39
|
+
wire_language.load_code_file('one.wire')
|
40
|
+
wire_language.load_code_file('two.wire')
|
41
|
+
|
42
|
+
wire_language.step_matches('','').should == [:a, :b, :c]
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
+
require 'cucumber/wire_support/wire_language'
|
3
|
+
|
4
|
+
module Cucumber
|
5
|
+
module WireSupport
|
6
|
+
describe WirePacket do
|
7
|
+
it "should convert to JSON" do
|
8
|
+
packet = WirePacket.new('test_message', :foo => :bar)
|
9
|
+
packet.to_json.should == "[\"test_message\",{\"foo\":\"bar\"}]"
|
10
|
+
end
|
11
|
+
|
12
|
+
describe ".parse" do
|
13
|
+
it "should understand a raw packet containing no arguments" do
|
14
|
+
packet = WirePacket.parse("[\"test_message\",null]")
|
15
|
+
packet.message.should == 'test_message'
|
16
|
+
packet.params.should be_nil
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should understand a raw packet containging arguments data" do
|
20
|
+
packet = WirePacket.parse("[\"test_message\",{\"foo\":\"bar\"}]")
|
21
|
+
packet.params['foo'].should == 'bar'
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucumber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Aslak Helles\xC3\xB8y"
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-10-
|
12
|
+
date: 2009-10-28 00:00:00 +01:00
|
13
13
|
default_executable: cucumber
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -100,7 +100,7 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.7.
|
103
|
+
version: 0.7.3
|
104
104
|
version:
|
105
105
|
description: A BDD tool written in Ruby
|
106
106
|
email: cukes@googlegroups.com
|
@@ -123,13 +123,6 @@ files:
|
|
123
123
|
- bin/cucumber
|
124
124
|
- cucumber.gemspec
|
125
125
|
- cucumber.yml
|
126
|
-
- examples/cs/.gitignore
|
127
|
-
- examples/cs/README.textile
|
128
|
-
- examples/cs/Rakefile
|
129
|
-
- examples/cs/compile.bat
|
130
|
-
- examples/cs/features/addition.feature
|
131
|
-
- examples/cs/features/step_definitons/calculator_steps.rb
|
132
|
-
- examples/cs/src/demo/Calculator.cs
|
133
126
|
- examples/dos_line_endings/Rakefile
|
134
127
|
- examples/dos_line_endings/features/dos_line_endings.feature
|
135
128
|
- examples/i18n/README.textile
|
@@ -151,9 +144,9 @@ files:
|
|
151
144
|
- examples/i18n/cat/features/suma.feature
|
152
145
|
- examples/i18n/cat/lib/calculadora.rb
|
153
146
|
- examples/i18n/da/Rakefile
|
154
|
-
- examples/i18n/da/features/
|
155
|
-
- examples/i18n/da/features/
|
156
|
-
- examples/i18n/da/lib/
|
147
|
+
- examples/i18n/da/features/sammenlaegning.feature
|
148
|
+
- examples/i18n/da/features/step_definitons/lommeregner_steps.rb
|
149
|
+
- examples/i18n/da/lib/lommeregner.rb
|
157
150
|
- examples/i18n/de/.gitignore
|
158
151
|
- examples/i18n/de/Rakefile
|
159
152
|
- examples/i18n/de/features/addition.feature
|
@@ -306,20 +299,9 @@ files:
|
|
306
299
|
- examples/i18n/zh-TW/features/division.feature
|
307
300
|
- examples/i18n/zh-TW/features/step_definitons/calculator_steps.rb
|
308
301
|
- examples/i18n/zh-TW/lib/calculator.rb
|
309
|
-
- examples/java/.gitignore
|
310
|
-
- examples/java/README.textile
|
311
|
-
- examples/java/build.xml
|
312
|
-
- examples/java/features/hello.feature
|
313
|
-
- examples/java/features/step_definitons/hello_steps.rb
|
314
|
-
- examples/java/features/step_definitons/tree_steps.rb
|
315
|
-
- examples/java/features/tree.feature
|
316
|
-
- examples/java/src/.gitignore
|
317
|
-
- examples/java/src/cucumber/demo/.gitignore
|
318
|
-
- examples/java/src/cucumber/demo/Hello.java
|
319
302
|
- examples/junit/features/one_passing_one_failing.feature
|
320
303
|
- examples/junit/features/pending.feature
|
321
304
|
- examples/junit/features/step_definitions/steps.rb
|
322
|
-
- examples/pure_java/README.textile
|
323
305
|
- examples/python/features/fibonacci.feature
|
324
306
|
- examples/python/features/step_definitions/fib_steps.py
|
325
307
|
- examples/python/lib/.gitignore
|
@@ -385,6 +367,7 @@ files:
|
|
385
367
|
- examples/test_unit/features/step_definitions/test_unit_steps.rb
|
386
368
|
- examples/test_unit/features/test_unit.feature
|
387
369
|
- examples/tickets/Rakefile
|
370
|
+
- examples/tickets/features.html
|
388
371
|
- examples/tickets/features/172.feature
|
389
372
|
- examples/tickets/features/177/1.feature
|
390
373
|
- examples/tickets/features/177/2.feature
|
@@ -418,11 +401,13 @@ files:
|
|
418
401
|
- examples/watir/README.textile
|
419
402
|
- examples/watir/Rakefile
|
420
403
|
- examples/watir/features/search.feature
|
421
|
-
- examples/watir/features/
|
404
|
+
- examples/watir/features/step_definitions/search_steps.rb
|
422
405
|
- examples/watir/features/support/env.rb
|
406
|
+
- examples/watir/features/support/screenshots.rb
|
423
407
|
- examples/webrat/features/search.feature
|
424
408
|
- examples/webrat/features/step_definitions/kvasir_steps.rb
|
425
409
|
- examples/webrat/features/support/env.rb
|
410
|
+
- features/announce.feature
|
426
411
|
- features/background.feature
|
427
412
|
- features/bug_371.feature
|
428
413
|
- features/bug_464.feature
|
@@ -455,13 +440,17 @@ files:
|
|
455
440
|
- features/step_definitions/cucumber_steps.rb
|
456
441
|
- features/step_definitions/extra_steps.rb
|
457
442
|
- features/step_definitions/simplest_steps.rb
|
443
|
+
- features/step_definitions/wire_steps.rb
|
458
444
|
- features/support/env.rb
|
459
445
|
- features/support/env.rb.simplest
|
446
|
+
- features/support/fake_wire_server.rb
|
460
447
|
- features/table_diffing.feature
|
461
448
|
- features/table_mapping.feature
|
449
|
+
- features/tag_logic.feature
|
462
450
|
- features/transform.feature
|
463
451
|
- features/unicode_table.feature
|
464
452
|
- features/usage_and_stepdefs_formatter.feature
|
453
|
+
- features/wire_protocol.feature
|
465
454
|
- features/work_in_progress.feature
|
466
455
|
- gem_tasks/contributors.rake
|
467
456
|
- gem_tasks/environment.rake
|
@@ -526,6 +515,7 @@ files:
|
|
526
515
|
- lib/cucumber/formatter/rerun.rb
|
527
516
|
- lib/cucumber/formatter/stepdefs.rb
|
528
517
|
- lib/cucumber/formatter/steps.rb
|
518
|
+
- lib/cucumber/formatter/summary.rb
|
529
519
|
- lib/cucumber/formatter/tag_cloud.rb
|
530
520
|
- lib/cucumber/formatter/unicode.rb
|
531
521
|
- lib/cucumber/formatter/usage.rb
|
@@ -564,6 +554,13 @@ files:
|
|
564
554
|
- lib/cucumber/step_mother.rb
|
565
555
|
- lib/cucumber/webrat/element_locator.rb
|
566
556
|
- lib/cucumber/webrat/table_locator.rb
|
557
|
+
- lib/cucumber/wire_support/connection.rb
|
558
|
+
- lib/cucumber/wire_support/request_handler.rb
|
559
|
+
- lib/cucumber/wire_support/wire_exception.rb
|
560
|
+
- lib/cucumber/wire_support/wire_language.rb
|
561
|
+
- lib/cucumber/wire_support/wire_packet.rb
|
562
|
+
- lib/cucumber/wire_support/wire_protocol.rb
|
563
|
+
- lib/cucumber/wire_support/wire_step_definition.rb
|
567
564
|
- rails_generators/cucumber/USAGE
|
568
565
|
- rails_generators/cucumber/cucumber_generator.rb
|
569
566
|
- rails_generators/cucumber/templates/cucumber
|
@@ -589,6 +586,7 @@ files:
|
|
589
586
|
- spec/cucumber/ast/step_collection_spec.rb
|
590
587
|
- spec/cucumber/ast/step_spec.rb
|
591
588
|
- spec/cucumber/ast/table_spec.rb
|
589
|
+
- spec/cucumber/ast/tags_spec.rb
|
592
590
|
- spec/cucumber/ast/tree_walker_spec.rb
|
593
591
|
- spec/cucumber/broadcaster_spec.rb
|
594
592
|
- spec/cucumber/cli/configuration_spec.rb
|
@@ -625,6 +623,8 @@ files:
|
|
625
623
|
- spec/cucumber/treetop_parser/test_dos.feature
|
626
624
|
- spec/cucumber/treetop_parser/with_comments.feature
|
627
625
|
- spec/cucumber/treetop_parser/with_tags.feature
|
626
|
+
- spec/cucumber/wire_support/wire_language_spec.rb
|
627
|
+
- spec/cucumber/wire_support/wire_packet_spec.rb
|
628
628
|
- spec/cucumber/world/pending_spec.rb
|
629
629
|
- spec/spec.opts
|
630
630
|
- spec/spec_helper.rb
|
@@ -634,15 +634,15 @@ licenses: []
|
|
634
634
|
|
635
635
|
post_install_message: |+
|
636
636
|
|
637
|
-
(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)
|
637
|
+
(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)
|
638
638
|
|
639
639
|
(::) U P G R A D I N G (::)
|
640
640
|
|
641
|
-
Thank you for installing cucumber-0.4.
|
641
|
+
Thank you for installing cucumber-0.4.3.
|
642
642
|
Please be sure to read http://wiki.github.com/aslakhellesoy/cucumber/upgrading
|
643
|
-
for important information about this release.
|
643
|
+
for important information about this release. Happy cuking!
|
644
644
|
|
645
|
-
(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)
|
645
|
+
(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)
|
646
646
|
|
647
647
|
rdoc_options:
|
648
648
|
- --charset=UTF-8
|
@@ -662,7 +662,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
662
662
|
version:
|
663
663
|
requirements: []
|
664
664
|
|
665
|
-
rubyforge_project:
|
665
|
+
rubyforge_project: rspec
|
666
666
|
rubygems_version: 1.3.5
|
667
667
|
signing_key:
|
668
668
|
specification_version: 3
|
@@ -679,6 +679,7 @@ test_files:
|
|
679
679
|
- spec/cucumber/ast/step_collection_spec.rb
|
680
680
|
- spec/cucumber/ast/step_spec.rb
|
681
681
|
- spec/cucumber/ast/table_spec.rb
|
682
|
+
- spec/cucumber/ast/tags_spec.rb
|
682
683
|
- spec/cucumber/ast/tree_walker_spec.rb
|
683
684
|
- spec/cucumber/broadcaster_spec.rb
|
684
685
|
- spec/cucumber/cli/configuration_spec.rb
|
@@ -701,9 +702,10 @@ test_files:
|
|
701
702
|
- spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
|
702
703
|
- spec/cucumber/step_match_spec.rb
|
703
704
|
- spec/cucumber/step_mother_spec.rb
|
705
|
+
- spec/cucumber/wire_support/wire_language_spec.rb
|
706
|
+
- spec/cucumber/wire_support/wire_packet_spec.rb
|
704
707
|
- spec/cucumber/world/pending_spec.rb
|
705
708
|
- spec/spec_helper.rb
|
706
|
-
- examples/cs/features/step_definitons/calculator_steps.rb
|
707
709
|
- examples/i18n/ar/features/step_definitons/calculator_steps.rb
|
708
710
|
- examples/i18n/ar/lib/calculator.rb
|
709
711
|
- examples/i18n/bg/features/step_definitons/calculator_steps.rb
|
@@ -712,8 +714,8 @@ test_files:
|
|
712
714
|
- examples/i18n/bg/lib/calculator.rb
|
713
715
|
- examples/i18n/cat/features/step_definitons/calculator_steps.rb
|
714
716
|
- examples/i18n/cat/lib/calculadora.rb
|
715
|
-
- examples/i18n/da/features/step_definitons/
|
716
|
-
- examples/i18n/da/lib/
|
717
|
+
- examples/i18n/da/features/step_definitons/lommeregner_steps.rb
|
718
|
+
- examples/i18n/da/lib/lommeregner.rb
|
717
719
|
- examples/i18n/de/features/step_definitons/calculator_steps.rb
|
718
720
|
- examples/i18n/de/lib/calculator.rb
|
719
721
|
- examples/i18n/en/features/step_definitons/calculator_steps.rb
|
@@ -779,8 +781,6 @@ test_files:
|
|
779
781
|
- examples/i18n/zh-CN/lib/calculator.rb
|
780
782
|
- examples/i18n/zh-TW/features/step_definitons/calculator_steps.rb
|
781
783
|
- examples/i18n/zh-TW/lib/calculator.rb
|
782
|
-
- examples/java/features/step_definitons/hello_steps.rb
|
783
|
-
- examples/java/features/step_definitons/tree_steps.rb
|
784
784
|
- examples/junit/features/step_definitions/steps.rb
|
785
785
|
- examples/ramaze/app.rb
|
786
786
|
- examples/ramaze/features/step_definitions/add_steps.rb
|
@@ -793,6 +793,7 @@ test_files:
|
|
793
793
|
- examples/selenium_webrat/features/support/env.rb
|
794
794
|
- examples/self_test/features/step_definitions/sample_steps.rb
|
795
795
|
- examples/self_test/features/support/env.rb
|
796
|
+
- examples/self_test/tmp/features/step_definitions/steps.rb
|
796
797
|
- examples/sinatra/app.rb
|
797
798
|
- examples/sinatra/features/step_definitions/add_steps.rb
|
798
799
|
- examples/sinatra/features/support/env.rb
|
@@ -810,7 +811,8 @@ test_files:
|
|
810
811
|
- examples/tickets/features/step_definitons/248_steps.rb
|
811
812
|
- examples/tickets/features/step_definitons/scenario_outline_steps.rb
|
812
813
|
- examples/tickets/features/step_definitons/tickets_steps.rb
|
813
|
-
- examples/watir/features/
|
814
|
+
- examples/watir/features/step_definitions/search_steps.rb
|
814
815
|
- examples/watir/features/support/env.rb
|
816
|
+
- examples/watir/features/support/screenshots.rb
|
815
817
|
- examples/webrat/features/step_definitions/kvasir_steps.rb
|
816
818
|
- examples/webrat/features/support/env.rb
|
data/examples/cs/.gitignore
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
*.dll
|
data/examples/cs/README.textile
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
See "IronRuby and .NET":http://github.com/aslakhellesoy/cucumber/wikis/ironruby-and-net
|
data/examples/cs/Rakefile
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
$:.unshift(File.dirname(__FILE__) + '/../../lib')
|
2
|
-
require 'cucumber/rake/task'
|
3
|
-
|
4
|
-
Cucumber::Rake::Task.new(:features) do |t|
|
5
|
-
t.cucumber_opts = %w{--format pretty}
|
6
|
-
end
|
7
|
-
|
8
|
-
task :features => :compile
|
9
|
-
|
10
|
-
task :compile do
|
11
|
-
sh "csc /target:library /out:Demo.dll src\\demo\\Calculator.cs"
|
12
|
-
end
|
data/examples/cs/compile.bat
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
csc /target:library /out:Calculator.dll src\demo\Calculator.cs
|
@@ -1,16 +0,0 @@
|
|
1
|
-
Feature: Addition
|
2
|
-
In order to avoid silly mistakes
|
3
|
-
As a math idiot
|
4
|
-
I want to be told the sum of two numbers
|
5
|
-
|
6
|
-
Scenario Outline: Add two numbers
|
7
|
-
Given I have entered <input_1> into the calculator
|
8
|
-
And I have entered <input_2> into the calculator
|
9
|
-
When I press add
|
10
|
-
Then the result should be <output> on the screen
|
11
|
-
|
12
|
-
Examples:
|
13
|
-
| input_1 | input_2 | output |
|
14
|
-
| 20 | 30 | 50 |
|
15
|
-
| 2 | 5 | 7 |
|
16
|
-
| 0 | 40 | 40 |
|
@@ -1,19 +0,0 @@
|
|
1
|
-
require 'spec/expectations'
|
2
|
-
$:.unshift(File.dirname(__FILE__) + '/../../') # This line is not needed in your own project
|
3
|
-
require 'Calculator' # Calculator.dll
|
4
|
-
|
5
|
-
Before do
|
6
|
-
@calc = Demo::Calculator.new # A .NET class in Calculator.dll
|
7
|
-
end
|
8
|
-
|
9
|
-
Given "I have entered $n into the calculator" do |n|
|
10
|
-
@calc.push n.to_i
|
11
|
-
end
|
12
|
-
|
13
|
-
When /I press add/ do
|
14
|
-
@result = @calc.Add
|
15
|
-
end
|
16
|
-
|
17
|
-
Then /the result should be (.*) on the screen/ do |result|
|
18
|
-
@result.should == result.to_i
|
19
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
using System;
|
2
|
-
using System.Collections.Generic;
|
3
|
-
|
4
|
-
namespace Demo {
|
5
|
-
public class Calculator {
|
6
|
-
private List<int>args = new List<int>();
|
7
|
-
|
8
|
-
public void Push(int n) {
|
9
|
-
args.Add(n);
|
10
|
-
}
|
11
|
-
|
12
|
-
public int Add() {
|
13
|
-
int result = 0;
|
14
|
-
foreach(int n in args) {
|
15
|
-
result += n;
|
16
|
-
}
|
17
|
-
return result;
|
18
|
-
}
|
19
|
-
}
|
20
|
-
}
|
data/examples/java/.gitignore
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
build
|
@@ -1,18 +0,0 @@
|
|
1
|
-
h1. Using Cucumber with Java
|
2
|
-
|
3
|
-
This directory contains code to demonstrate how Cucumber can be used to develop Java code.
|
4
|
-
|
5
|
-
h2. Installing required gems
|
6
|
-
|
7
|
-
jruby -S gem install cucumber
|
8
|
-
jruby -S gem install diff-lcs
|
9
|
-
|
10
|
-
h2. Running the scenarios
|
11
|
-
|
12
|
-
Open a shell in this directory (java) and execute the following command:
|
13
|
-
|
14
|
-
<pre>ant</pre>
|
15
|
-
|
16
|
-
There is a deliberate error. See if you can fix it!
|
17
|
-
|
18
|
-
Also see "Cuke4Duke":http://wiki.github.com/aslakhellesoy/cuke4duke for more powerful JVM and Java support for Cucumber.
|
data/examples/java/build.xml
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
<project name="Cucumber Demo" default="cucumber" basedir=".">
|
2
|
-
<target name ="compile" description="Compile classes">
|
3
|
-
<mkdir dir="build" />
|
4
|
-
<javac srcdir="src" destdir="build" />
|
5
|
-
</target>
|
6
|
-
|
7
|
-
<target name="cucumber" depends="compile" description="Run Cucumber">
|
8
|
-
<property environment="ENV" />
|
9
|
-
<fail unless="ENV.JRUBY_HOME">
|
10
|
-
(::) ERROR (::)
|
11
|
-
Define JRUBY_HOME in your shell. For example:
|
12
|
-
|
13
|
-
export JRUBY_HOME=/usr/local/jruby
|
14
|
-
set JRUBY_HOME=C:\jruby
|
15
|
-
</fail>
|
16
|
-
<java classname="org.jruby.Main" fork="true" failonerror="true">
|
17
|
-
<classpath>
|
18
|
-
<pathelement path="${ENV.JRUBY_HOME}/lib/jruby.jar"/>
|
19
|
-
<pathelement path="build"/>
|
20
|
-
</classpath>
|
21
|
-
<jvmarg value="-Djruby.home=${ENV.JRUBY_HOME}"/>
|
22
|
-
<arg value="-S"/>
|
23
|
-
<arg value="cucumber"/>
|
24
|
-
<arg value="--format"/>
|
25
|
-
<arg value="pretty"/>
|
26
|
-
<arg value="--format"/>
|
27
|
-
<arg value="junit"/>
|
28
|
-
<arg value="--out"/>
|
29
|
-
<arg value="build"/>
|
30
|
-
<arg value="features"/>
|
31
|
-
</java>
|
32
|
-
</target>
|
33
|
-
</project>
|
@@ -1,11 +0,0 @@
|
|
1
|
-
Feature: Hello
|
2
|
-
In order to have more friends
|
3
|
-
I want to say hello
|
4
|
-
|
5
|
-
Scenario: Personal greeting
|
6
|
-
Given my name is Aslak
|
7
|
-
When I greet David
|
8
|
-
Then he should hear Hi, David. I'm Aslak.
|
9
|
-
And I should remember David as a friend
|
10
|
-
And I should get David's phone number
|
11
|
-
|