rspec 1.1.12 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.autotest +2 -1
- data/.document +7 -0
- data/History.txt +58 -0
- data/License.txt +1 -1
- data/Manifest.txt +45 -82
- data/README.txt +3 -6
- data/Rakefile +33 -13
- data/Ruby1.9.markdown +32 -0
- data/TODO.txt +10 -4
- data/Upgrade.markdown +63 -0
- data/bin/spec +1 -1
- data/cucumber.yml +3 -0
- data/examples/failing/{failing_autogenerated_docstrings_example.rb → failing_implicit_docstrings_example.rb} +0 -0
- data/examples/failing/pending_example.rb +9 -0
- data/examples/failing/spec_helper.rb +1 -1
- data/examples/passing/{custom_expectation_matchers.rb → custom_matchers.rb} +0 -0
- data/examples/passing/filtered_formatter.rb +18 -0
- data/examples/passing/filtered_formatter_example.rb +31 -0
- data/examples/passing/implicit_docstrings_example.rb +18 -0
- data/examples/passing/spec_helper.rb +1 -1
- data/examples/ruby1.9.compatibility/access_to_constants_spec.rb +17 -18
- data/features/before_and_after_blocks/before_and_after_blocks.feature +4 -4
- data/features/example_groups/example_group_with_should_methods.feature +1 -1
- data/features/example_groups/{autogenerated_docstrings.feature → implicit_docstrings.feature} +7 -9
- data/features/example_groups/nested_groups.feature +1 -1
- data/features/heckle/heckle.feature +56 -0
- data/features/interop/examples_and_tests_together.feature +1 -1
- data/features/interop/test_but_not_test_unit.feature +1 -1
- data/features/interop/test_case_with_should_methods.feature +1 -1
- data/features/matchers/create_matcher.feature +115 -0
- data/features/mock_framework_integration/use_flexmock.feature +22 -4
- data/features/mock_framework_integration/use_mocha.feature +27 -0
- data/features/mock_framework_integration/use_rr.feature +27 -0
- data/features/mocks/mix_stubs_and_mocks.feature +22 -0
- data/features/pending/pending_examples.feature +81 -0
- data/features/step_definitions/running_rspec.rb +5 -3
- data/features/support/env.rb +1 -1
- data/features/support/matchers/smart_match.rb +2 -2
- data/lib/autotest/rspec.rb +1 -1
- data/lib/spec.rb +1 -1
- data/lib/{adapters → spec/adapters}/mock_frameworks/flexmock.rb +0 -0
- data/lib/{adapters → spec/adapters}/mock_frameworks/mocha.rb +0 -0
- data/lib/{adapters → spec/adapters}/mock_frameworks/rr.rb +0 -0
- data/lib/{adapters → spec/adapters}/mock_frameworks/rspec.rb +0 -1
- data/lib/spec/autorun.rb +3 -0
- data/lib/spec/dsl.rb +3 -1
- data/lib/spec/dsl/matchers.rb +13 -0
- data/lib/spec/example.rb +4 -0
- data/lib/spec/example/before_and_after_hooks.rb +5 -20
- data/lib/spec/example/errors.rb +3 -3
- data/lib/spec/example/example_description.rb +15 -0
- data/lib/spec/example/example_group.rb +0 -15
- data/lib/spec/example/example_group_factory.rb +34 -46
- data/lib/spec/example/example_group_hierarchy.rb +53 -0
- data/lib/spec/example/example_group_methods.rb +101 -211
- data/lib/spec/example/example_methods.rb +61 -81
- data/lib/spec/example/module_reopening_fix.rb +23 -1
- data/lib/spec/example/pending.rb +3 -2
- data/lib/spec/example/predicate_matchers.rb +47 -0
- data/lib/spec/example/subject.rb +91 -0
- data/lib/spec/expectations.rb +1 -1
- data/lib/spec/expectations/differs/default.rb +0 -1
- data/lib/spec/expectations/extensions.rb +0 -1
- data/lib/spec/expectations/handler.rb +13 -6
- data/lib/spec/interop/test.rb +5 -0
- data/lib/spec/interop/test/unit/testcase.rb +5 -22
- data/lib/spec/matchers.rb +22 -8
- data/lib/spec/matchers/be.rb +4 -9
- data/lib/spec/matchers/be_close.rb +20 -5
- data/lib/spec/matchers/be_instance_of.rb +45 -0
- data/lib/spec/matchers/be_kind_of.rb +45 -0
- data/lib/spec/matchers/change.rb +8 -6
- data/lib/spec/matchers/compatibility.rb +14 -0
- data/lib/spec/matchers/eql.rb +24 -6
- data/lib/spec/matchers/equal.rb +24 -6
- data/lib/spec/matchers/exist.rb +21 -5
- data/lib/spec/matchers/extensions/instance_exec.rb +25 -0
- data/lib/spec/matchers/generated_descriptions.rb +2 -2
- data/lib/spec/matchers/has.rb +28 -11
- data/lib/spec/matchers/have.rb +2 -2
- data/lib/spec/matchers/include.rb +2 -2
- data/lib/spec/matchers/match.rb +25 -7
- data/lib/spec/matchers/match_array.rb +3 -3
- data/lib/spec/matchers/matcher.rb +51 -0
- data/lib/spec/matchers/method_missing.rb +2 -2
- data/lib/spec/matchers/operator_matcher.rb +12 -5
- data/lib/spec/matchers/raise_error.rb +3 -3
- data/lib/spec/matchers/respond_to.rb +3 -3
- data/lib/spec/matchers/satisfy.rb +7 -7
- data/lib/spec/matchers/throw_symbol.rb +3 -5
- data/lib/spec/mocks.rb +3 -3
- data/lib/spec/mocks/argument_expectation.rb +15 -15
- data/lib/spec/mocks/{argument_constraints.rb → argument_matchers.rb} +19 -23
- data/lib/spec/mocks/error_generator.rb +5 -8
- data/lib/spec/mocks/framework.rb +1 -1
- data/lib/spec/mocks/message_expectation.rb +5 -13
- data/lib/spec/mocks/mock.rb +4 -5
- data/lib/spec/mocks/proxy.rb +9 -5
- data/lib/spec/mocks/spec_methods.rb +10 -1
- data/lib/spec/rake/spectask.rb +0 -1
- data/lib/spec/runner.rb +6 -28
- data/lib/spec/runner/configuration.rb +3 -3
- data/lib/spec/runner/drb_command_line.rb +2 -1
- data/lib/spec/runner/example_group_runner.rb +3 -2
- data/lib/spec/runner/formatter/base_text_formatter.rb +34 -19
- data/lib/spec/runner/formatter/failing_example_groups_formatter.rb +3 -5
- data/lib/spec/runner/formatter/html_formatter.rb +2 -3
- data/lib/spec/runner/formatter/nested_text_formatter.rb +7 -25
- data/lib/spec/runner/formatter/progress_bar_formatter.rb +1 -1
- data/lib/spec/runner/formatter/snippet_extractor.rb +1 -1
- data/lib/spec/runner/formatter/specdoc_formatter.rb +1 -7
- data/lib/spec/runner/heckle_runner.rb +3 -6
- data/lib/spec/runner/heckle_runner_unsupported.rb +1 -1
- data/lib/spec/runner/option_parser.rb +19 -21
- data/lib/spec/runner/options.rb +32 -27
- data/lib/spec/runner/reporter.rb +8 -9
- data/lib/spec/test/unit.rb +10 -0
- data/lib/spec/version.rb +2 -2
- data/{features/support → resources}/helpers/cmdline.rb +2 -2
- data/resources/rake/verify_rcov.rake +1 -1
- data/resources/spec/example_group_with_should_methods.rb +1 -1
- data/resources/spec/simple_spec.rb +1 -1
- data/resources/test/spec_and_test_together.rb +2 -3
- data/resources/test/spec_including_test_but_not_unit.rb +1 -1
- data/resources/test/test_case_with_should_methods.rb +2 -3
- data/spec/autotest/autotest_helper.rb +0 -1
- data/spec/autotest/rspec_spec.rb +95 -98
- data/spec/spec/dsl/main_spec.rb +3 -3
- data/spec/spec/dsl/matchers_spec.rb +25 -0
- data/spec/spec/example/example_group_class_definition_spec.rb +14 -15
- data/spec/spec/example/example_group_factory_spec.rb +31 -44
- data/spec/spec/example/example_group_methods_spec.rb +86 -52
- data/spec/spec/example/example_group_spec.rb +32 -79
- data/spec/spec/example/example_matcher_spec.rb +10 -10
- data/spec/spec/example/example_methods_spec.rb +108 -242
- data/spec/spec/example/nested_example_group_spec.rb +2 -2
- data/spec/spec/example/pending_module_spec.rb +66 -41
- data/spec/spec/example/shared_example_group_spec.rb +4 -4
- data/spec/spec/{matchers → expectations}/handler_spec.rb +52 -4
- data/spec/spec/interop/test/unit/resources/spec_that_fails.rb +2 -2
- data/spec/spec/interop/test/unit/resources/spec_that_passes.rb +2 -2
- data/spec/spec/interop/test/unit/resources/spec_with_errors.rb +2 -2
- data/spec/spec/interop/test/unit/resources/spec_with_options_hash.rb +2 -2
- data/spec/spec/interop/test/unit/resources/test_case_that_fails.rb +2 -2
- data/spec/spec/interop/test/unit/resources/test_case_that_passes.rb +2 -2
- data/spec/spec/interop/test/unit/resources/test_case_with_errors.rb +2 -2
- data/spec/spec/interop/test/unit/resources/testsuite_adapter_spec_with_test_unit.rb +2 -2
- data/spec/spec/interop/test/unit/testcase_spec.rb +0 -4
- data/spec/spec/matchers/be_close_spec.rb +1 -1
- data/spec/spec/matchers/be_instance_of_spec.rb +29 -0
- data/spec/spec/matchers/be_kind_of_spec.rb +29 -0
- data/spec/spec/matchers/change_spec.rb +20 -0
- data/spec/spec/matchers/compatibility_spec.rb +34 -0
- data/spec/spec/matchers/description_generation_spec.rb +0 -12
- data/spec/spec/matchers/eql_spec.rb +2 -2
- data/spec/spec/matchers/equal_spec.rb +2 -2
- data/spec/spec/matchers/exist_spec.rb +8 -4
- data/spec/spec/matchers/have_spec.rb +4 -4
- data/spec/spec/matchers/match_spec.rb +2 -2
- data/spec/spec/matchers/matcher_methods_spec.rb +1 -1
- data/spec/spec/matchers/matcher_spec.rb +97 -0
- data/spec/spec/matchers/throw_symbol_spec.rb +8 -8
- data/spec/spec/mocks/{bug_report_496.rb → bug_report_496_spec.rb} +0 -0
- data/spec/spec/mocks/{failing_mock_argument_constraints_spec.rb → failing_argument_matchers_spec.rb} +2 -2
- data/spec/spec/mocks/hash_including_matcher_spec.rb +4 -4
- data/spec/spec/mocks/hash_not_including_matcher_spec.rb +3 -3
- data/spec/spec/mocks/mock_spec.rb +27 -2
- data/spec/spec/mocks/nil_expectation_warning_spec.rb +1 -1
- data/spec/spec/mocks/partial_mock_spec.rb +18 -3
- data/spec/spec/mocks/{passing_mock_argument_constraints_spec.rb → passing_argument_matchers_spec.rb} +6 -6
- data/spec/spec/mocks/stubbed_message_expectations_spec.rb +13 -1
- data/spec/spec/package/bin_spec_spec.rb +2 -2
- data/spec/spec/runner/configuration_spec.rb +12 -12
- data/spec/spec/runner/drb_command_line_spec.rb +71 -73
- data/spec/spec/runner/formatter/base_text_formatter_spec.rb +82 -1
- data/spec/spec/runner/formatter/failing_example_groups_formatter_spec.rb +8 -8
- data/spec/spec/runner/formatter/failing_examples_formatter_spec.rb +4 -4
- data/spec/spec/runner/formatter/html_formatted-1.8.6.html +8 -8
- data/spec/spec/runner/formatter/html_formatted-1.8.7.html +38 -26
- data/spec/spec/runner/formatter/html_formatted-1.9.1.html +61 -53
- data/spec/spec/runner/formatter/html_formatter_spec.rb +100 -48
- data/spec/spec/runner/formatter/nested_text_formatter_spec.rb +20 -34
- data/spec/spec/runner/formatter/profile_formatter_spec.rb +2 -1
- data/spec/spec/runner/formatter/progress_bar_formatter_spec.rb +9 -6
- data/spec/spec/runner/formatter/specdoc_formatter_spec.rb +6 -6
- data/spec/spec/runner/formatter/text_mate_formatted-1.8.6.html +20 -20
- data/spec/spec/runner/formatter/text_mate_formatted-1.8.7.html +38 -26
- data/spec/spec/runner/formatter/text_mate_formatted-1.9.1.html +55 -47
- data/spec/spec/runner/formatter/{spec_mate_formatter_spec.rb → text_mate_formatter_spec.rb} +11 -9
- data/spec/spec/runner/heckle_runner_spec.rb +1 -1
- data/spec/spec/runner/heckler_spec.rb +1 -1
- data/spec/spec/runner/option_parser_spec.rb +28 -11
- data/spec/spec/runner/options_spec.rb +34 -0
- data/spec/spec/runner/reporter_spec.rb +66 -62
- data/spec/spec/runner/resources/utf8_encoded.rb +1 -0
- data/spec/spec/runner/spec_drb.opts +1 -0
- data/spec/spec/runner_spec.rb +7 -5
- data/spec/spec_helper.rb +24 -2
- metadata +49 -90
- data/examples/passing/autogenerated_docstrings_example.rb +0 -25
- data/examples/passing/before_and_after_example.rb +0 -40
- data/examples/passing/behave_as_example.rb +0 -45
- data/examples/passing/legacy_spec.rb +0 -11
- data/examples/passing/priority.txt +0 -1
- data/features/support/helpers/story_helper.rb +0 -16
- data/lib/spec/expectations/extensions/string_and_symbol.rb +0 -17
- data/lib/spec/runner/formatter/story/html_formatter.rb +0 -174
- data/lib/spec/runner/formatter/story/plain_text_formatter.rb +0 -194
- data/lib/spec/runner/formatter/story/progress_bar_formatter.rb +0 -42
- data/lib/spec/story.rb +0 -10
- data/lib/spec/story/extensions.rb +0 -3
- data/lib/spec/story/extensions/main.rb +0 -86
- data/lib/spec/story/extensions/regexp.rb +0 -9
- data/lib/spec/story/extensions/string.rb +0 -9
- data/lib/spec/story/given_scenario.rb +0 -14
- data/lib/spec/story/runner.rb +0 -57
- data/lib/spec/story/runner/plain_text_story_runner.rb +0 -48
- data/lib/spec/story/runner/scenario_collector.rb +0 -18
- data/lib/spec/story/runner/scenario_runner.rb +0 -54
- data/lib/spec/story/runner/story_mediator.rb +0 -137
- data/lib/spec/story/runner/story_parser.rb +0 -247
- data/lib/spec/story/runner/story_runner.rb +0 -74
- data/lib/spec/story/scenario.rb +0 -14
- data/lib/spec/story/step.rb +0 -70
- data/lib/spec/story/step_group.rb +0 -89
- data/lib/spec/story/step_mother.rb +0 -38
- data/lib/spec/story/story.rb +0 -39
- data/lib/spec/story/world.rb +0 -124
- data/resources/spec/spec_with_flexmock.rb +0 -19
- data/rspec.gemspec +0 -32
- data/spec/spec/matchers/mock_constraint_matchers_spec.rb +0 -24
- data/spec/spec/runner/formatter/story/html_formatter_spec.rb +0 -135
- data/spec/spec/runner/formatter/story/plain_text_formatter_spec.rb +0 -600
- data/spec/spec/runner/formatter/story/progress_bar_formatter_spec.rb +0 -82
- data/spec/spec/spec_spec.rb +0 -21
- data/spec/spec/story/builders.rb +0 -46
- data/spec/spec/story/extensions/main_spec.rb +0 -161
- data/spec/spec/story/extensions_spec.rb +0 -14
- data/spec/spec/story/given_scenario_spec.rb +0 -27
- data/spec/spec/story/runner/plain_text_story_runner_spec.rb +0 -90
- data/spec/spec/story/runner/scenario_collector_spec.rb +0 -27
- data/spec/spec/story/runner/scenario_runner_spec.rb +0 -214
- data/spec/spec/story/runner/story_mediator_spec.rb +0 -143
- data/spec/spec/story/runner/story_parser_spec.rb +0 -401
- data/spec/spec/story/runner/story_runner_spec.rb +0 -294
- data/spec/spec/story/runner_spec.rb +0 -93
- data/spec/spec/story/scenario_spec.rb +0 -18
- data/spec/spec/story/step_group_spec.rb +0 -157
- data/spec/spec/story/step_mother_spec.rb +0 -84
- data/spec/spec/story/step_spec.rb +0 -272
- data/spec/spec/story/story_helper.rb +0 -2
- data/spec/spec/story/story_spec.rb +0 -84
- data/spec/spec/story/world_spec.rb +0 -423
- data/story_server/prototype/javascripts/builder.js +0 -136
- data/story_server/prototype/javascripts/controls.js +0 -972
- data/story_server/prototype/javascripts/dragdrop.js +0 -976
- data/story_server/prototype/javascripts/effects.js +0 -1117
- data/story_server/prototype/javascripts/prototype.js +0 -4140
- data/story_server/prototype/javascripts/rspec.js +0 -149
- data/story_server/prototype/javascripts/scriptaculous.js +0 -58
- data/story_server/prototype/javascripts/slider.js +0 -276
- data/story_server/prototype/javascripts/sound.js +0 -55
- data/story_server/prototype/javascripts/unittest.js +0 -568
- data/story_server/prototype/lib/server.rb +0 -24
- data/story_server/prototype/stories.html +0 -176
- data/story_server/prototype/stylesheets/rspec.css +0 -136
- data/story_server/prototype/stylesheets/test.css +0 -90
@@ -1,24 +0,0 @@
|
|
1
|
-
require 'webrick'
|
2
|
-
|
3
|
-
class DispatchServlet < WEBrick::HTTPServlet::AbstractServlet
|
4
|
-
def do_POST(request, response)
|
5
|
-
File.open('story', 'w') do |io|
|
6
|
-
io.write(request.body)
|
7
|
-
end
|
8
|
-
|
9
|
-
response.status = 200
|
10
|
-
response['Content-Type'] = 'text/html'
|
11
|
-
response.body = "body"
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
params = { :Port => 4000,
|
16
|
-
:ServerType => WEBrick::SimpleServer,
|
17
|
-
:BindAddress => "0.0.0.0",
|
18
|
-
:MimeTypes => WEBrick::HTTPUtils::DefaultMimeTypes }
|
19
|
-
server = WEBrick::HTTPServer.new(params)
|
20
|
-
server.mount('/stories', DispatchServlet)
|
21
|
-
server.mount('/', WEBrick::HTTPServlet::FileHandler, File.dirname(__FILE__) + '/..', { :FancyIndexing => true })
|
22
|
-
|
23
|
-
trap("INT") { server.shutdown }
|
24
|
-
server.start
|
@@ -1,176 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
5
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
6
|
-
<head>
|
7
|
-
<title>Stories</title>
|
8
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
9
|
-
<meta http-equiv="Expires" content="-1" />
|
10
|
-
<meta http-equiv="Pragma" content="no-cache" />
|
11
|
-
<script src="javascripts/prototype.js" type="text/javascript"></script>
|
12
|
-
<script src="javascripts/scriptaculous.js" type="text/javascript"></script>
|
13
|
-
<script src="javascripts/rspec.js" type="text/javascript"></script>
|
14
|
-
<script src="javascripts/unittest.js" type="text/javascript"></script>
|
15
|
-
|
16
|
-
<link href="stylesheets/rspec.css" rel="stylesheet" type="text/css" />
|
17
|
-
<link href="stylesheets/test.css" rel="stylesheet" type="text/css" />
|
18
|
-
</head>
|
19
|
-
<body>
|
20
|
-
<!--
|
21
|
-
Classes and ids that are only used by the Story UI, which don't have to be present in
|
22
|
-
the Example report:
|
23
|
-
|
24
|
-
#nav
|
25
|
-
#stock_steps
|
26
|
-
dl.story
|
27
|
-
ul.steps
|
28
|
-
-->
|
29
|
-
<div id="nav">
|
30
|
-
<a href="#" onclick="javascript:StoryDom.save();">SAVE</a>
|
31
|
-
</div>
|
32
|
-
<div id="container">
|
33
|
-
<ul id="stock_steps" style="display: none;">
|
34
|
-
<li>Given my savings account balance is $balance dollars</li>
|
35
|
-
<li>Given my cash account balance is $balance dollars</li>
|
36
|
-
<li>Given my $which account has been blocked for $n days</li>
|
37
|
-
<li>When I transfer $amount dollars</li>
|
38
|
-
<li>Then my savings account balance should be $balance dollars</li>
|
39
|
-
<li>Then my cash account balance should be $balance dollars</li>
|
40
|
-
</ul>
|
41
|
-
<dl class="story failed">
|
42
|
-
<dt>transfer to cash account</dt>
|
43
|
-
<dd>
|
44
|
-
<p>
|
45
|
-
As a savings account holder<br />
|
46
|
-
I want to transfer money from my savings account<br />
|
47
|
-
So that I can get cash easily from an ATM<br />
|
48
|
-
</p>
|
49
|
-
<dl class="passed">
|
50
|
-
<dt>savings account is in credit</dt>
|
51
|
-
<dd>
|
52
|
-
<ul class="steps">
|
53
|
-
<li class="passed">Given my savings account balance is <span class="param">100</span> dollars</li>
|
54
|
-
<li class="passed">Given my cash account balance is <span class="param">10</span> dollars</li>
|
55
|
-
<li class="passed">When I transfer <span class="param">20</span> dollars</li>
|
56
|
-
<li class="passed">Then my savings account balance should be <span class="param">80</span> dollars</li>
|
57
|
-
<li class="passed">Then my cash account balance should be <span class="param">30</span> dollars</li>
|
58
|
-
</ul>
|
59
|
-
</dd>
|
60
|
-
</dl>
|
61
|
-
|
62
|
-
<dl class="failed">
|
63
|
-
<dt>savings account is overdrawn</dt>
|
64
|
-
<dd>
|
65
|
-
<ul class="steps">
|
66
|
-
<li class="passed">Given my savings account balance is <span class="param">-20</span> dollars</li>
|
67
|
-
<li class="passed">Given my cash account balance is <span class="param">10</span> dollars</li>
|
68
|
-
<li class="passed">When I transfer <span class="param">20</span> dollars</li>
|
69
|
-
<li class="failed">Then my savings account balance should be <span class="param">-20</span> dollars</li>
|
70
|
-
<li class="failed">Then my cash account balance should be <span class="param">10</span> dollars</li>
|
71
|
-
<li class="pending">Then I should still be poor</li>
|
72
|
-
</ul>
|
73
|
-
</dd>
|
74
|
-
</dl>
|
75
|
-
</dd>
|
76
|
-
</dl>
|
77
|
-
<!-- More stories here... -->
|
78
|
-
|
79
|
-
<!-- Tests follow -->
|
80
|
-
<div id="testlog"> </div>
|
81
|
-
<script type="text/javascript" language="javascript" charset="utf-8">
|
82
|
-
// <![CDATA[
|
83
|
-
Test.context("RSpec editor tests (this won't be in the final editor - it's just self tests)",{
|
84
|
-
'should extract story narrative': function() {
|
85
|
-
var narrative = StoryDom.narrativeText($$('p')[0].innerHTML);
|
86
|
-
narrative.shouldEqual(
|
87
|
-
" As a savings account holder\n" +
|
88
|
-
" I want to transfer money from my savings account\n" +
|
89
|
-
" So that I can get cash easily from an ATM\n"
|
90
|
-
);
|
91
|
-
},
|
92
|
-
|
93
|
-
'should extract step text with two spans': function() {
|
94
|
-
var stepText = StoryDom.stepText('Given <span class="param">this</span> and <span class="param">that</span> stuff');
|
95
|
-
stepText.shouldEqual("Given this and that stuff");
|
96
|
-
},
|
97
|
-
|
98
|
-
'should extract scenario': function() {
|
99
|
-
var scenario = StoryDom.scenario($$('dl')[1]);
|
100
|
-
scenario.shouldEqual(
|
101
|
-
" Scenario: savings account is in credit\n" +
|
102
|
-
" Given my savings account balance is 100 dollars\n" +
|
103
|
-
" Given my cash account balance is 10 dollars\n" +
|
104
|
-
" When I transfer 20 dollars\n" +
|
105
|
-
" Then my savings account balance should be 80 dollars\n" +
|
106
|
-
" Then my cash account balance should be 30 dollars\n"
|
107
|
-
);
|
108
|
-
},
|
109
|
-
|
110
|
-
'should extract story from page': function() {
|
111
|
-
var story = StoryDom.story();
|
112
|
-
story.shouldEqual(
|
113
|
-
"Story: transfer to cash account\n" +
|
114
|
-
"\n" +
|
115
|
-
" As a savings account holder\n" +
|
116
|
-
" I want to transfer money from my savings account\n" +
|
117
|
-
" So that I can get cash easily from an ATM\n" +
|
118
|
-
"\n" +
|
119
|
-
" Scenario: savings account is in credit\n" +
|
120
|
-
" Given my savings account balance is 100 dollars\n" +
|
121
|
-
" Given my cash account balance is 10 dollars\n" +
|
122
|
-
" When I transfer 20 dollars\n" +
|
123
|
-
" Then my savings account balance should be 80 dollars\n" +
|
124
|
-
" Then my cash account balance should be 30 dollars\n" +
|
125
|
-
"\n" +
|
126
|
-
" Scenario: savings account is overdrawn\n" +
|
127
|
-
" Given my savings account balance is -20 dollars\n" +
|
128
|
-
" Given my cash account balance is 10 dollars\n" +
|
129
|
-
" When I transfer 20 dollars\n" +
|
130
|
-
" Then my savings account balance should be -20 dollars\n" +
|
131
|
-
" Then my cash account balance should be 10 dollars\n" +
|
132
|
-
" Then I should still be poor\n"
|
133
|
-
);
|
134
|
-
},
|
135
|
-
|
136
|
-
'should extract stock steps from dom': function() {
|
137
|
-
var stockSteps = RSpec.stockSteps();
|
138
|
-
stockSteps.shouldEqualEnum([
|
139
|
-
'Given my $which account has been blocked for $n days',
|
140
|
-
'Given my cash account balance is $balance dollars',
|
141
|
-
'Given my savings account balance is $balance dollars',
|
142
|
-
'Then my cash account balance should be $balance dollars',
|
143
|
-
'Then my savings account balance should be $balance dollars',
|
144
|
-
'When I transfer $amount dollars'
|
145
|
-
]);
|
146
|
-
},
|
147
|
-
|
148
|
-
'should add new stock steps unless they already exist': function() {
|
149
|
-
RSpec.addStockStep('When Godzilla chews over a cable');
|
150
|
-
RSpec.stockSteps().shouldEqualEnum([
|
151
|
-
'Given my $which account has been blocked for $n days',
|
152
|
-
'Given my cash account balance is $balance dollars',
|
153
|
-
'Given my savings account balance is $balance dollars',
|
154
|
-
'Then my cash account balance should be $balance dollars',
|
155
|
-
'Then my savings account balance should be $balance dollars',
|
156
|
-
'When Godzilla chews over a cable',
|
157
|
-
'When I transfer $amount dollars'
|
158
|
-
]);
|
159
|
-
RSpec.addStockStep('When Godzilla chews over a cable');
|
160
|
-
RSpec.stockSteps().shouldEqualEnum([
|
161
|
-
'Given my $which account has been blocked for $n days',
|
162
|
-
'Given my cash account balance is $balance dollars',
|
163
|
-
'Given my savings account balance is $balance dollars',
|
164
|
-
'Then my cash account balance should be $balance dollars',
|
165
|
-
'Then my savings account balance should be $balance dollars',
|
166
|
-
'When Godzilla chews over a cable',
|
167
|
-
'When I transfer $amount dollars'
|
168
|
-
]);
|
169
|
-
}
|
170
|
-
});
|
171
|
-
// ]]>
|
172
|
-
</script>
|
173
|
-
|
174
|
-
</div>
|
175
|
-
</body>
|
176
|
-
</html>
|
@@ -1,136 +0,0 @@
|
|
1
|
-
body {
|
2
|
-
background: #fff;
|
3
|
-
font-size: 80%;
|
4
|
-
margin:0pt;
|
5
|
-
padding:0pt;
|
6
|
-
}
|
7
|
-
|
8
|
-
#nav {
|
9
|
-
border-bottom:1px solid #222222;
|
10
|
-
border-top-style:solid;
|
11
|
-
border-top-width:0.5em;
|
12
|
-
font-family:Helvetica,Arial,sans-serif;
|
13
|
-
font-size:1.1em;
|
14
|
-
padding:0.2em 0pt;
|
15
|
-
position:fixed;
|
16
|
-
text-align:center;
|
17
|
-
width:100%;
|
18
|
-
z-index:50;
|
19
|
-
|
20
|
-
background-color: #000000;
|
21
|
-
opacity: 0.6;
|
22
|
-
}
|
23
|
-
|
24
|
-
#container {
|
25
|
-
background:white none repeat scroll 0%;
|
26
|
-
font-family:Helvetica,Arial,sans-serif;
|
27
|
-
margin:0pt auto;
|
28
|
-
position:relative;
|
29
|
-
text-align:left;
|
30
|
-
top:4.0em;
|
31
|
-
width:78em;
|
32
|
-
}
|
33
|
-
|
34
|
-
dl {
|
35
|
-
font: normal 11px "Lucida Grande", Helvetica, sans-serif;
|
36
|
-
}
|
37
|
-
|
38
|
-
dt {
|
39
|
-
color: #fff;
|
40
|
-
}
|
41
|
-
|
42
|
-
dl.passed {
|
43
|
-
border-left: 5px solid #65C400;
|
44
|
-
}
|
45
|
-
|
46
|
-
dl.failed {
|
47
|
-
border-left: 5px solid #C20000;
|
48
|
-
}
|
49
|
-
|
50
|
-
dt {
|
51
|
-
padding: 3px;
|
52
|
-
font-weight: bold;
|
53
|
-
}
|
54
|
-
|
55
|
-
dd {
|
56
|
-
margin: 0px 0px 0px 0px;
|
57
|
-
}
|
58
|
-
|
59
|
-
dd p {
|
60
|
-
padding: 5px;
|
61
|
-
margin-top: 0;
|
62
|
-
margin-bottom: 5px;
|
63
|
-
}
|
64
|
-
|
65
|
-
dd > dl {
|
66
|
-
margin-left: 5px;
|
67
|
-
}
|
68
|
-
|
69
|
-
dl.passed > dt {
|
70
|
-
background: #65C400;
|
71
|
-
}
|
72
|
-
|
73
|
-
dl.failed > dt {
|
74
|
-
background: #C20000;
|
75
|
-
}
|
76
|
-
|
77
|
-
dl.passed > dd > p, li.passed {
|
78
|
-
background: #DBFFB4; color: #3D7700;
|
79
|
-
border-bottom: 1px solid #65C400;
|
80
|
-
}
|
81
|
-
|
82
|
-
dl.failed > dd > p, li.failed {
|
83
|
-
color: #C20000; background: #FFFBD3;
|
84
|
-
border-bottom: 1px solid #C20000;
|
85
|
-
}
|
86
|
-
|
87
|
-
dl.pending > dd > p, li.pending {
|
88
|
-
color: #131313; background: #FCFB98;
|
89
|
-
border-bottom: 1px solid #FAF834;
|
90
|
-
}
|
91
|
-
|
92
|
-
dl.new > dd > p, li.new {
|
93
|
-
color: #444444; background: #DDDDDD;
|
94
|
-
border-bottom: 1px solid #444444;
|
95
|
-
}
|
96
|
-
|
97
|
-
dl > dd > p.wastebin {
|
98
|
-
background-color: black;
|
99
|
-
}
|
100
|
-
|
101
|
-
span.param, span.param_editor {
|
102
|
-
font-weight: bold;
|
103
|
-
}
|
104
|
-
|
105
|
-
input {
|
106
|
-
width: 100%;
|
107
|
-
}
|
108
|
-
|
109
|
-
ul.steps {
|
110
|
-
padding: 0px;
|
111
|
-
list-style: none;
|
112
|
-
}
|
113
|
-
|
114
|
-
ul.steps > li {
|
115
|
-
margin: 5px 0px 5px 5px;
|
116
|
-
padding: 3px 3px 3px 5px;
|
117
|
-
}
|
118
|
-
|
119
|
-
div.auto_complete ul {
|
120
|
-
list-style-type: none;
|
121
|
-
border: 2px solid #F0F0F0;
|
122
|
-
margin: 0px;
|
123
|
-
padding: 0px;
|
124
|
-
}
|
125
|
-
|
126
|
-
div.auto_complete ul li {
|
127
|
-
background-color: white;
|
128
|
-
list-style-type: none;
|
129
|
-
display: block;
|
130
|
-
margin: 0;
|
131
|
-
padding: 2px;
|
132
|
-
}
|
133
|
-
|
134
|
-
div.auto_complete ul li.selected {
|
135
|
-
color: #444444; background: #DDDDDD;
|
136
|
-
}
|
@@ -1,90 +0,0 @@
|
|
1
|
-
body, div, p, h1, h2, h3, ul, ol, span, a, table, td, form, img, li {
|
2
|
-
font-family: sans-serif;
|
3
|
-
}
|
4
|
-
|
5
|
-
body {
|
6
|
-
font-size:0.8em;
|
7
|
-
}
|
8
|
-
|
9
|
-
.navigation {
|
10
|
-
background: #9DC569;
|
11
|
-
color: #fff;
|
12
|
-
}
|
13
|
-
|
14
|
-
.navigation h1 {
|
15
|
-
font-size: 20px;
|
16
|
-
}
|
17
|
-
|
18
|
-
.navigation h2 {
|
19
|
-
font-size: 16px;
|
20
|
-
font-weight: normal;
|
21
|
-
margin: 0;
|
22
|
-
border: 1px solid #e8a400;
|
23
|
-
border-bottom: 0;
|
24
|
-
background: #ffc;
|
25
|
-
color: #E8A400;
|
26
|
-
padding: 8px;
|
27
|
-
padding-bottom: 0;
|
28
|
-
}
|
29
|
-
|
30
|
-
.navigation ul {
|
31
|
-
margin-top: 0;
|
32
|
-
border: 1px solid #E8A400;
|
33
|
-
border-top: none;
|
34
|
-
background: #ffc;
|
35
|
-
padding: 8px;
|
36
|
-
margin-left: 0;
|
37
|
-
}
|
38
|
-
|
39
|
-
.navigation ul li {
|
40
|
-
font-size: 12px;
|
41
|
-
list-style-type: none;
|
42
|
-
margin-top: 1px;
|
43
|
-
margin-bottom: 1px;
|
44
|
-
color: #555;
|
45
|
-
}
|
46
|
-
|
47
|
-
.navigation a {
|
48
|
-
color: #ffc;
|
49
|
-
}
|
50
|
-
|
51
|
-
.navigation ul li a {
|
52
|
-
color: #000;
|
53
|
-
}
|
54
|
-
|
55
|
-
#log {
|
56
|
-
padding-bottom: 1em;
|
57
|
-
border-bottom: 2px solid #000;
|
58
|
-
margin-bottom: 2em;
|
59
|
-
}
|
60
|
-
|
61
|
-
#logsummary {
|
62
|
-
margin-bottom: 1em;
|
63
|
-
padding: 1ex;
|
64
|
-
border: 1px solid #000;
|
65
|
-
font-weight: bold;
|
66
|
-
}
|
67
|
-
|
68
|
-
#logtable {
|
69
|
-
width:100%;
|
70
|
-
border-collapse: collapse;
|
71
|
-
border: 1px dotted #666;
|
72
|
-
}
|
73
|
-
|
74
|
-
#logtable td, #logtable th {
|
75
|
-
text-align: left;
|
76
|
-
padding: 3px 8px;
|
77
|
-
border: 1px dotted #666;
|
78
|
-
}
|
79
|
-
|
80
|
-
#logtable .passed {
|
81
|
-
background-color: #cfc;
|
82
|
-
}
|
83
|
-
|
84
|
-
#logtable .failed, #logtable .error {
|
85
|
-
background-color: #fcc;
|
86
|
-
}
|
87
|
-
|
88
|
-
#logtable .nameCell {
|
89
|
-
cursor: pointer;
|
90
|
-
}
|