rspec 1.1.11 → 1.1.12
Sign up to get free protection for your applications and to get access to all the features.
- data/.autotest +4 -0
- data/History.txt +55 -0
- data/Manifest.txt +102 -122
- data/README.txt +30 -12
- data/Rakefile +10 -10
- data/TODO.txt +10 -2
- data/{failing_examples → examples/failing}/README.txt +0 -0
- data/{failing_examples → examples/failing}/diffing_spec.rb +0 -0
- data/{failing_examples → examples/failing}/failing_autogenerated_docstrings_example.rb +0 -0
- data/{failing_examples/failure_in_teardown.rb → examples/failing/failure_in_after.rb} +1 -1
- data/{failing_examples/failure_in_setup.rb → examples/failing/failure_in_before.rb} +1 -1
- data/{failing_examples → examples/failing}/mocking_example.rb +0 -0
- data/{failing_examples → examples/failing}/mocking_with_flexmock.rb +0 -0
- data/{failing_examples → examples/failing}/mocking_with_mocha.rb +0 -0
- data/{failing_examples → examples/failing}/mocking_with_rr.rb +0 -0
- data/{failing_examples → examples/failing}/partial_mock_example.rb +0 -0
- data/{failing_examples → examples/failing}/predicate_example.rb +5 -0
- data/{failing_examples → examples/failing}/raising_example.rb +0 -0
- data/{failing_examples → examples/failing}/spec_helper.rb +1 -1
- data/{failing_examples → examples/failing}/syntax_error_example.rb +0 -0
- data/{failing_examples → examples/failing}/team_spec.rb +0 -0
- data/{failing_examples → examples/failing}/timeout_behaviour.rb +0 -0
- data/examples/{pure → passing}/autogenerated_docstrings_example.rb +6 -0
- data/examples/{pure → passing}/before_and_after_example.rb +0 -0
- data/examples/{pure → passing}/behave_as_example.rb +0 -0
- data/examples/{pure → passing}/custom_expectation_matchers.rb +0 -0
- data/examples/{pure → passing}/custom_formatter.rb +1 -1
- data/examples/{pure → passing}/dynamic_spec.rb +2 -2
- data/examples/{pure → passing}/file_accessor.rb +0 -0
- data/examples/{pure → passing}/file_accessor_spec.rb +0 -0
- data/examples/{pure → passing}/greeter_spec.rb +0 -0
- data/examples/{pure → passing}/helper_method_example.rb +0 -0
- data/examples/{pure → passing}/io_processor.rb +0 -0
- data/examples/{pure → passing}/io_processor_spec.rb +0 -0
- data/examples/{pure → passing}/legacy_spec.rb +0 -0
- data/examples/{pure → passing}/mocking_example.rb +0 -0
- data/examples/{pure/multi_threaded_behaviour_runner.rb → passing/multi_threaded_example_group_runner.rb} +1 -3
- data/examples/{pure → passing}/nested_classes_example.rb +0 -0
- data/examples/{pure → passing}/partial_mock_example.rb +0 -0
- data/examples/{pure → passing}/pending_example.rb +0 -0
- data/examples/{pure → passing}/predicate_example.rb +0 -0
- data/examples/{pure → passing}/priority.txt +0 -0
- data/examples/{pure → passing}/shared_example_group_example.rb +0 -0
- data/examples/{pure → passing}/shared_stack_examples.rb +1 -3
- data/examples/passing/simple_matcher_example.rb +31 -0
- data/examples/{pure → passing}/spec_helper.rb +0 -0
- data/examples/{pure → passing}/stack.rb +0 -0
- data/examples/{pure → passing}/stack_spec.rb +3 -2
- data/examples/{pure → passing}/stack_spec_with_nested_example_groups.rb +0 -0
- data/examples/{pure → passing}/stubbing_example.rb +0 -0
- data/examples/{pure → passing}/yielding_example.rb +0 -0
- data/examples/ruby1.9.compatibility/access_to_constants_spec.rb +86 -0
- data/features/before_and_after_blocks/before_and_after_blocks.feature +168 -0
- data/{stories/example_groups/autogenerated_docstrings → features/example_groups/autogenerated_docstrings.feature} +5 -5
- data/{stories/example_groups/example_group_with_should_methods → features/example_groups/example_group_with_should_methods.feature} +3 -3
- data/{stories/example_groups/nested_groups → features/example_groups/nested_groups.feature} +4 -4
- data/{stories/example_groups/output → features/example_groups/output.feature} +3 -8
- data/{stories/interop/examples_and_tests_together → features/interop/examples_and_tests_together.feature} +5 -4
- data/features/interop/test_but_not_test_unit.feature +14 -0
- data/{stories/interop/test_case_with_should_methods → features/interop/test_case_with_should_methods.feature} +2 -2
- data/{stories/mock_framework_integration/use_flexmock.story → features/mock_framework_integration/use_flexmock.feature} +1 -1
- data/features/step_definitions/running_rspec.rb +54 -0
- data/features/support/env.rb +26 -0
- data/{stories/resources → features/support}/helpers/cmdline.rb +0 -0
- data/{stories/resources → features/support}/helpers/story_helper.rb +1 -1
- data/{stories/resources → features/support}/matchers/smart_match.rb +0 -0
- data/{plugins → lib/adapters}/mock_frameworks/flexmock.rb +1 -1
- data/{plugins → lib/adapters}/mock_frameworks/mocha.rb +1 -1
- data/{plugins → lib/adapters}/mock_frameworks/rr.rb +1 -1
- data/{plugins → lib/adapters}/mock_frameworks/rspec.rb +2 -2
- data/lib/autotest/rspec.rb +4 -3
- data/lib/spec.rb +2 -27
- data/lib/spec/dsl.rb +1 -0
- data/lib/spec/{extensions → dsl}/main.rb +10 -10
- data/lib/spec/example.rb +175 -1
- data/lib/spec/example/before_and_after_hooks.rb +30 -24
- data/lib/spec/example/example_group.rb +1 -0
- data/lib/spec/example/example_group_factory.rb +26 -9
- data/lib/spec/example/example_group_methods.rb +138 -113
- data/lib/spec/example/example_methods.rb +88 -25
- data/lib/spec/example/shared_example_group.rb +28 -21
- data/lib/spec/expectations.rb +22 -18
- data/lib/spec/expectations/handler.rb +16 -36
- data/lib/spec/interop/test/unit/testcase.rb +19 -17
- data/lib/spec/interop/test/unit/testresult.rb +1 -1
- data/lib/spec/interop/test/unit/testsuite_adapter.rb +1 -1
- data/lib/spec/matchers.rb +7 -28
- data/lib/spec/matchers/be.rb +103 -116
- data/lib/spec/matchers/be_close.rb +6 -22
- data/lib/spec/matchers/eql.rb +7 -25
- data/lib/spec/matchers/equal.rb +7 -25
- data/lib/spec/matchers/errors.rb +5 -0
- data/lib/spec/matchers/exist.rb +8 -14
- data/lib/spec/matchers/generated_descriptions.rb +48 -0
- data/lib/spec/matchers/has.rb +12 -28
- data/lib/spec/matchers/include.rb +12 -9
- data/lib/spec/matchers/match.rb +8 -27
- data/lib/spec/matchers/match_array.rb +79 -0
- data/lib/spec/matchers/method_missing.rb +9 -0
- data/lib/spec/matchers/operator_matcher.rb +39 -48
- data/lib/spec/matchers/raise_error.rb +4 -8
- data/lib/spec/matchers/respond_to.rb +33 -8
- data/lib/spec/matchers/throw_symbol.rb +49 -17
- data/lib/spec/matchers/wrap_expectation.rb +55 -0
- data/lib/spec/mocks/argument_constraints.rb +77 -5
- data/lib/spec/mocks/message_expectation.rb +7 -7
- data/lib/spec/mocks/proxy.rb +14 -12
- data/lib/spec/rake/spectask.rb +4 -6
- data/lib/spec/ruby.rb +9 -0
- data/lib/spec/runner.rb +37 -162
- data/lib/spec/runner/backtrace_tweaker.rb +5 -3
- data/lib/spec/runner/class_and_arguments_parser.rb +7 -9
- data/lib/spec/runner/command_line.rb +6 -8
- data/lib/spec/{example → runner}/configuration.rb +46 -47
- data/lib/spec/runner/example_group_runner.rb +15 -4
- data/lib/spec/runner/formatter/base_text_formatter.rb +4 -3
- data/lib/spec/runner/formatter/html_formatter.rb +14 -11
- data/lib/spec/runner/formatter/nested_text_formatter.rb +2 -2
- data/lib/spec/runner/heckle_runner.rb +58 -56
- data/lib/spec/runner/option_parser.rb +8 -4
- data/lib/spec/runner/options.rb +29 -14
- data/lib/spec/runner/reporter.rb +1 -1
- data/lib/spec/runner/spec_parser.rb +11 -9
- data/lib/spec/story/runner.rb +40 -42
- data/lib/spec/story/runner/story_runner.rb +10 -6
- data/lib/spec/story/world.rb +66 -70
- data/lib/spec/version.rb +4 -2
- data/{rake_tasks → resources/rake}/examples.rake +0 -0
- data/{rake_tasks → resources/rake}/examples_with_rcov.rake +0 -0
- data/{rake_tasks → resources/rake}/failing_examples_with_html.rake +0 -0
- data/{rake_tasks → resources/rake}/verify_rcov.rake +0 -0
- data/{stories/resources → resources}/spec/example_group_with_should_methods.rb +1 -1
- data/{stories/resources → resources}/spec/simple_spec.rb +1 -1
- data/resources/spec/spec_with_flexmock.rb +19 -0
- data/{stories/resources → resources}/test/spec_and_test_together.rb +1 -1
- data/resources/test/spec_including_test_but_not_unit.rb +11 -0
- data/{stories/resources → resources}/test/test_case_with_should_methods.rb +2 -2
- data/rspec.gemspec +16 -6
- data/spec/autotest/autotest_helper.rb +2 -2
- data/spec/autotest/discover_spec.rb +4 -15
- data/spec/autotest/failed_results_re_spec.rb +24 -0
- data/spec/autotest/rspec_spec.rb +2 -38
- data/spec/spec/dsl/main_spec.rb +88 -0
- data/spec/spec/example/example_group_class_definition_spec.rb +6 -2
- data/spec/spec/example/example_group_factory_spec.rb +50 -10
- data/spec/spec/example/example_group_methods_spec.rb +210 -160
- data/spec/spec/example/example_group_spec.rb +44 -52
- data/spec/spec/example/example_matcher_spec.rb +6 -23
- data/spec/spec/example/example_methods_spec.rb +176 -54
- data/spec/spec/example/helper_method_spec.rb +24 -0
- data/spec/spec/example/pending_module_spec.rb +2 -8
- data/spec/spec/example/shared_example_group_spec.rb +56 -80
- data/spec/spec/expectations/extensions/object_spec.rb +0 -50
- data/spec/spec/expectations/wrap_expectation_spec.rb +30 -0
- data/spec/spec/interop/test/unit/spec_spec.rb +1 -5
- data/spec/spec/interop/test/unit/test_unit_spec_helper.rb +4 -0
- data/spec/spec/matchers/be_close_spec.rb +12 -10
- data/spec/spec/matchers/be_spec.rb +62 -7
- data/spec/spec/matchers/description_generation_spec.rb +19 -0
- data/spec/spec/matchers/eql_spec.rb +7 -6
- data/spec/spec/matchers/equal_spec.rb +7 -6
- data/spec/spec/matchers/handler_spec.rb +4 -43
- data/spec/spec/matchers/has_spec.rb +1 -1
- data/spec/spec/matchers/have_spec.rb +23 -18
- data/spec/spec/matchers/include_spec.rb +24 -0
- data/spec/spec/matchers/match_array_spec.rb +83 -0
- data/spec/spec/matchers/matcher_methods_spec.rb +1 -13
- data/spec/spec/matchers/raise_error_spec.rb +18 -0
- data/spec/spec/matchers/respond_to_spec.rb +71 -9
- data/spec/spec/matchers/throw_symbol_spec.rb +85 -43
- data/spec/spec/mocks/bug_report_11545_spec.rb +4 -5
- data/spec/spec/mocks/bug_report_496.rb +11 -9
- data/spec/spec/mocks/bug_report_600_spec.rb +22 -0
- data/spec/spec/mocks/hash_including_matcher_spec.rb +39 -2
- data/spec/spec/mocks/hash_not_including_matcher_spec.rb +67 -0
- data/spec/spec/mocks/mock_spec.rb +5 -6
- data/spec/spec/mocks/nil_expectation_warning_spec.rb +2 -2
- data/spec/spec/mocks/passing_mock_argument_constraints_spec.rb +18 -3
- data/spec/spec/mocks/stub_spec.rb +6 -0
- data/spec/spec/mocks/stubbed_message_expectations_spec.rb +14 -0
- data/spec/spec/runner/command_line_spec.rb +4 -4
- data/spec/spec/runner/configuration_spec.rb +301 -0
- data/spec/spec/runner/drb_command_line_spec.rb +4 -4
- data/spec/spec/runner/example_group_runner_spec.rb +33 -0
- data/spec/spec/runner/formatter/base_formatter_spec.rb +13 -102
- data/spec/spec/runner/formatter/base_text_formatter_spec.rb +23 -0
- data/spec/spec/runner/formatter/failing_example_groups_formatter_spec.rb +5 -5
- data/spec/spec/runner/formatter/failing_examples_formatter_spec.rb +3 -3
- data/spec/spec/runner/formatter/html_formatted-1.8.4.html +6 -6
- data/spec/spec/runner/formatter/html_formatted-1.8.5-jruby.html +9 -9
- data/spec/spec/runner/formatter/html_formatted-1.8.5.html +6 -6
- data/spec/spec/runner/formatter/html_formatted-1.8.6-jruby.html +10 -10
- data/spec/spec/runner/formatter/html_formatted-1.8.6.html +39 -30
- data/spec/spec/runner/formatter/html_formatted-1.8.7.html +379 -0
- data/spec/spec/runner/formatter/html_formatted-1.9.1.html +379 -0
- data/spec/spec/runner/formatter/html_formatter_spec.rb +14 -13
- data/spec/spec/runner/formatter/nested_text_formatter_spec.rb +5 -5
- data/spec/spec/runner/formatter/progress_bar_formatter_spec.rb +7 -17
- data/spec/spec/runner/formatter/spec_mate_formatter_spec.rb +18 -17
- data/spec/spec/runner/formatter/specdoc_formatter_spec.rb +5 -5
- data/spec/spec/runner/formatter/text_mate_formatted-1.8.4.html +6 -6
- data/spec/spec/runner/formatter/text_mate_formatted-1.8.6.html +33 -30
- data/spec/spec/runner/formatter/text_mate_formatted-1.8.7.html +373 -0
- data/spec/spec/runner/formatter/text_mate_formatted-1.9.1.html +373 -0
- data/spec/spec/runner/heckler_spec.rb +16 -9
- data/spec/spec/runner/option_parser_spec.rb +3 -18
- data/spec/spec/runner/options_spec.rb +27 -8
- data/spec/spec/runner/reporter_spec.rb +5 -5
- data/spec/spec/runner/resources/custom_example_group_runner.rb +14 -0
- data/spec/spec/runner/resources/utf8_encoded.rb +7 -0
- data/spec/spec/runner/spec_parser_spec.rb +85 -79
- data/spec/spec/spec_spec.rb +21 -0
- data/spec/spec_helper.rb +9 -1
- data/story_server/prototype/javascripts/prototype.js +1 -1
- metadata +119 -131
- data/examples/stories/adder.rb +0 -13
- data/examples/stories/addition +0 -34
- data/examples/stories/addition.rb +0 -9
- data/examples/stories/calculator.rb +0 -65
- data/examples/stories/game-of-life/.loadpath +0 -5
- data/examples/stories/game-of-life/README.txt +0 -21
- data/examples/stories/game-of-life/behaviour/everything.rb +0 -6
- data/examples/stories/game-of-life/behaviour/examples/examples.rb +0 -3
- data/examples/stories/game-of-life/behaviour/examples/game_behaviour.rb +0 -35
- data/examples/stories/game-of-life/behaviour/examples/grid_behaviour.rb +0 -66
- data/examples/stories/game-of-life/behaviour/stories/CellsWithLessThanTwoNeighboursDie.story +0 -21
- data/examples/stories/game-of-life/behaviour/stories/CellsWithMoreThanThreeNeighboursDie.story +0 -21
- data/examples/stories/game-of-life/behaviour/stories/EmptySpacesWithThreeNeighboursCreateACell.story +0 -42
- data/examples/stories/game-of-life/behaviour/stories/ICanCreateACell.story +0 -42
- data/examples/stories/game-of-life/behaviour/stories/ICanKillACell.story +0 -17
- data/examples/stories/game-of-life/behaviour/stories/TheGridWraps.story +0 -53
- data/examples/stories/game-of-life/behaviour/stories/create_a_cell.rb +0 -52
- data/examples/stories/game-of-life/behaviour/stories/helper.rb +0 -6
- data/examples/stories/game-of-life/behaviour/stories/kill_a_cell.rb +0 -26
- data/examples/stories/game-of-life/behaviour/stories/steps.rb +0 -5
- data/examples/stories/game-of-life/behaviour/stories/stories.rb +0 -3
- data/examples/stories/game-of-life/behaviour/stories/stories.txt +0 -22
- data/examples/stories/game-of-life/life.rb +0 -3
- data/examples/stories/game-of-life/life/game.rb +0 -23
- data/examples/stories/game-of-life/life/grid.rb +0 -43
- data/examples/stories/helper.rb +0 -9
- data/examples/stories/steps/addition_steps.rb +0 -18
- data/lib/spec/adapters.rb +0 -1
- data/lib/spec/adapters/ruby_engine.rb +0 -26
- data/lib/spec/adapters/ruby_engine/mri.rb +0 -8
- data/lib/spec/adapters/ruby_engine/rubinius.rb +0 -8
- data/lib/spec/extensions.rb +0 -4
- data/lib/spec/extensions/class.rb +0 -24
- data/lib/spec/extensions/metaclass.rb +0 -7
- data/lib/spec/extensions/object.rb +0 -6
- data/spec/spec/adapters/ruby_engine_spec.rb +0 -16
- data/spec/spec/example/configuration_spec.rb +0 -296
- data/spec/spec/example/example_runner_spec.rb +0 -194
- data/spec/spec/extensions/main_spec.rb +0 -71
- data/stories/all.rb +0 -5
- data/stories/configuration/before_blocks.story +0 -21
- data/stories/configuration/stories.rb +0 -7
- data/stories/example_groups/stories.rb +0 -7
- data/stories/helper.rb +0 -6
- data/stories/interop/stories.rb +0 -7
- data/stories/mock_framework_integration/stories.rb +0 -7
- data/stories/pending_stories/README +0 -3
- data/stories/resources/spec/before_blocks_example.rb +0 -32
- data/stories/resources/spec/spec_with_flexmock.rb +0 -18
- data/stories/resources/steps/running_rspec.rb +0 -50
- data/stories/resources/stories/failing_story.rb +0 -15
- data/stories/stories/multiline_steps.story +0 -23
- data/stories/stories/steps/multiline_steps.rb +0 -13
- data/stories/stories/stories.rb +0 -6
@@ -0,0 +1,373 @@
|
|
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>RSpec results</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
|
+
<style type="text/css">
|
12
|
+
body {
|
13
|
+
margin: 0;
|
14
|
+
padding: 0;
|
15
|
+
background: #fff;
|
16
|
+
font-size: 80%;
|
17
|
+
}
|
18
|
+
</style>
|
19
|
+
<script type="text/javascript">
|
20
|
+
// <![CDATA[
|
21
|
+
function moveProgressBar(percentDone) {
|
22
|
+
document.getElementById("rspec-header").style.width = percentDone +"%";
|
23
|
+
}
|
24
|
+
function makeRed(element_id) {
|
25
|
+
document.getElementById(element_id).style.background = '#C40D0D';
|
26
|
+
document.getElementById(element_id).style.color = '#FFFFFF';
|
27
|
+
}
|
28
|
+
|
29
|
+
function makeYellow(element_id) {
|
30
|
+
if (element_id == "rspec-header" && document.getElementById(element_id).style.background != '#C40D0D')
|
31
|
+
{
|
32
|
+
document.getElementById(element_id).style.background = '#FAF834';
|
33
|
+
document.getElementById(element_id).style.color = '#000000';
|
34
|
+
}
|
35
|
+
else
|
36
|
+
{
|
37
|
+
document.getElementById(element_id).style.background = '#FAF834';
|
38
|
+
document.getElementById(element_id).style.color = '#000000';
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
// ]]>
|
43
|
+
</script>
|
44
|
+
<style type="text/css">
|
45
|
+
#rspec-header {
|
46
|
+
background: #65C400; color: #fff; height: 42px;
|
47
|
+
}
|
48
|
+
|
49
|
+
.rspec-report h1 {
|
50
|
+
margin: 0px 10px 0px 10px;
|
51
|
+
padding: 10px;
|
52
|
+
font-family: "Lucida Grande", Helvetica, sans-serif;
|
53
|
+
font-size: 1.8em;
|
54
|
+
float: left;
|
55
|
+
}
|
56
|
+
|
57
|
+
#summary {
|
58
|
+
margin: 0; padding: 5px 10px;
|
59
|
+
font-family: "Lucida Grande", Helvetica, sans-serif;
|
60
|
+
text-align: right;
|
61
|
+
top: 0px;
|
62
|
+
right: 0px;
|
63
|
+
float:right;
|
64
|
+
}
|
65
|
+
|
66
|
+
#summary p {
|
67
|
+
margin: 0 0 0 2px;
|
68
|
+
}
|
69
|
+
|
70
|
+
#summary #totals {
|
71
|
+
font-size: 1.2em;
|
72
|
+
}
|
73
|
+
|
74
|
+
.example_group {
|
75
|
+
margin: 0 10px 5px;
|
76
|
+
background: #fff;
|
77
|
+
}
|
78
|
+
|
79
|
+
dl {
|
80
|
+
margin: 0; padding: 0 0 5px;
|
81
|
+
font: normal 11px "Lucida Grande", Helvetica, sans-serif;
|
82
|
+
}
|
83
|
+
|
84
|
+
dt {
|
85
|
+
padding: 3px;
|
86
|
+
background: #65C400;
|
87
|
+
color: #fff;
|
88
|
+
font-weight: bold;
|
89
|
+
}
|
90
|
+
|
91
|
+
dd {
|
92
|
+
margin: 5px 0 5px 5px;
|
93
|
+
padding: 3px 3px 3px 18px;
|
94
|
+
}
|
95
|
+
|
96
|
+
dd.spec.passed {
|
97
|
+
border-left: 5px solid #65C400;
|
98
|
+
border-bottom: 1px solid #65C400;
|
99
|
+
background: #DBFFB4; color: #3D7700;
|
100
|
+
}
|
101
|
+
|
102
|
+
dd.spec.failed {
|
103
|
+
border-left: 5px solid #C20000;
|
104
|
+
border-bottom: 1px solid #C20000;
|
105
|
+
color: #C20000; background: #FFFBD3;
|
106
|
+
}
|
107
|
+
|
108
|
+
dd.spec.not_implemented {
|
109
|
+
border-left: 5px solid #FAF834;
|
110
|
+
border-bottom: 1px solid #FAF834;
|
111
|
+
background: #FCFB98; color: #131313;
|
112
|
+
}
|
113
|
+
|
114
|
+
dd.spec.pending_fixed {
|
115
|
+
border-left: 5px solid #0000C2;
|
116
|
+
border-bottom: 1px solid #0000C2;
|
117
|
+
color: #0000C2; background: #D3FBFF;
|
118
|
+
}
|
119
|
+
|
120
|
+
.backtrace {
|
121
|
+
color: #000;
|
122
|
+
font-size: 12px;
|
123
|
+
}
|
124
|
+
|
125
|
+
a {
|
126
|
+
color: #BE5C00;
|
127
|
+
}
|
128
|
+
|
129
|
+
/* Ruby code, style similar to vibrant ink */
|
130
|
+
.ruby {
|
131
|
+
font-size: 12px;
|
132
|
+
font-family: monospace;
|
133
|
+
color: white;
|
134
|
+
background-color: black;
|
135
|
+
padding: 0.1em 0 0.2em 0;
|
136
|
+
}
|
137
|
+
|
138
|
+
.ruby .keyword { color: #FF6600; }
|
139
|
+
.ruby .constant { color: #339999; }
|
140
|
+
.ruby .attribute { color: white; }
|
141
|
+
.ruby .global { color: white; }
|
142
|
+
.ruby .module { color: white; }
|
143
|
+
.ruby .class { color: white; }
|
144
|
+
.ruby .string { color: #66FF00; }
|
145
|
+
.ruby .ident { color: white; }
|
146
|
+
.ruby .method { color: #FFCC00; }
|
147
|
+
.ruby .number { color: white; }
|
148
|
+
.ruby .char { color: white; }
|
149
|
+
.ruby .comment { color: #9933CC; }
|
150
|
+
.ruby .symbol { color: white; }
|
151
|
+
.ruby .regex { color: #44B4CC; }
|
152
|
+
.ruby .punct { color: white; }
|
153
|
+
.ruby .escape { color: white; }
|
154
|
+
.ruby .interp { color: white; }
|
155
|
+
.ruby .expr { color: white; }
|
156
|
+
|
157
|
+
.ruby .offending { background-color: gray; }
|
158
|
+
.ruby .linenum {
|
159
|
+
width: 75px;
|
160
|
+
padding: 0.1em 1em 0.2em 0;
|
161
|
+
color: #000000;
|
162
|
+
background-color: #FFFBD3;
|
163
|
+
}
|
164
|
+
|
165
|
+
</style>
|
166
|
+
</head>
|
167
|
+
<body>
|
168
|
+
<div class="rspec-report">
|
169
|
+
|
170
|
+
<div id="rspec-header">
|
171
|
+
<div id="label">
|
172
|
+
<h1>RSpec Results</h1>
|
173
|
+
</div>
|
174
|
+
|
175
|
+
<div id="summary">
|
176
|
+
<p id="totals"> </p>
|
177
|
+
<p id="duration"> </p>
|
178
|
+
</div>
|
179
|
+
</div>
|
180
|
+
|
181
|
+
<div class="results">
|
182
|
+
<div class="example_group">
|
183
|
+
<dl>
|
184
|
+
<dt id="example_group_1">Mocker</dt>
|
185
|
+
<script type="text/javascript">moveProgressBar('5.8');</script>
|
186
|
+
<dd class="spec passed"><span class="passed_spec_name">should be able to call mock()</span></dd>
|
187
|
+
<script type="text/javascript">makeRed('rspec-header');</script>
|
188
|
+
<script type="text/javascript">makeRed('example_group_1');</script>
|
189
|
+
<script type="text/javascript">moveProgressBar('11.7');</script>
|
190
|
+
<dd class="spec failed">
|
191
|
+
<span class="failed_spec_name">should fail when expected message not received</span>
|
192
|
+
<div class="failure" id="failure_1">
|
193
|
+
<div class="message"><pre>Mock 'poke me' expected :poke with (any args) once, but received it 0 times</pre></div>
|
194
|
+
<div class="backtrace"><pre><a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/examples/failing/mocking_example.rb&line=13">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/examples/failing/mocking_example.rb:13</a> :in `block (2 levels) in <top (required)>'
|
195
|
+
<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=51">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb:51</a> :in `block (4 levels) in <module:Formatter>'
|
196
|
+
<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=47">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb:47</a> :in `chdir'
|
197
|
+
<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=47">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb:47</a> :in `block (3 levels) in <module:Formatter>'</pre></div>
|
198
|
+
<pre class="ruby"><code><span class="linenum">11</span> <span class="ident">it</span> <span class="punct">"</span><span class="string">should fail when expected message not received</span><span class="punct">"</span> <span class="keyword">do</span>
|
199
|
+
<span class="linenum">12</span> <span class="ident">mock</span> <span class="punct">=</span> <span class="ident">mock</span><span class="punct">("</span><span class="string">poke me</span><span class="punct">")</span>
|
200
|
+
<span class="offending"><span class="linenum">13</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">should_receive</span><span class="punct">(</span><span class="symbol">:poke</span><span class="punct">)</span></span>
|
201
|
+
<span class="linenum">14</span> <span class="keyword">end</span>
|
202
|
+
<span class="linenum">15</span> </code></pre>
|
203
|
+
</div>
|
204
|
+
</dd>
|
205
|
+
<script type="text/javascript">moveProgressBar('17.6');</script>
|
206
|
+
<dd class="spec failed">
|
207
|
+
<span class="failed_spec_name">should fail when messages are received out of order</span>
|
208
|
+
<div class="failure" id="failure_2">
|
209
|
+
<div class="message"><pre>Mock 'one two three' received :three out of order</pre></div>
|
210
|
+
<div class="backtrace"><pre><a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/examples/failing/mocking_example.rb&line=22">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/examples/failing/mocking_example.rb:22</a> :in `block (2 levels) in <top (required)>'
|
211
|
+
<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=51">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb:51</a> :in `block (4 levels) in <module:Formatter>'
|
212
|
+
<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=47">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb:47</a> :in `chdir'
|
213
|
+
<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=47">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb:47</a> :in `block (3 levels) in <module:Formatter>'</pre></div>
|
214
|
+
<pre class="ruby"><code><span class="linenum">20</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">should_receive</span><span class="punct">(</span><span class="symbol">:three</span><span class="punct">).</span><span class="ident">ordered</span>
|
215
|
+
<span class="linenum">21</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">one</span>
|
216
|
+
<span class="offending"><span class="linenum">22</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">three</span></span>
|
217
|
+
<span class="linenum">23</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">two</span>
|
218
|
+
<span class="linenum">24</span> <span class="keyword">end</span></code></pre>
|
219
|
+
</div>
|
220
|
+
</dd>
|
221
|
+
<script type="text/javascript">moveProgressBar('23.5');</script>
|
222
|
+
<dd class="spec failed">
|
223
|
+
<span class="failed_spec_name">should get yelled at when sending unexpected messages</span>
|
224
|
+
<div class="failure" id="failure_3">
|
225
|
+
<div class="message"><pre>Mock 'don't talk to me' expected :any_message_at_all with (no args) 0 times, but received it once</pre></div>
|
226
|
+
<div class="backtrace"><pre><a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/examples/failing/mocking_example.rb&line=29">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/examples/failing/mocking_example.rb:29</a> :in `block (2 levels) in <top (required)>'
|
227
|
+
<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=51">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb:51</a> :in `block (4 levels) in <module:Formatter>'
|
228
|
+
<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=47">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb:47</a> :in `chdir'
|
229
|
+
<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=47">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb:47</a> :in `block (3 levels) in <module:Formatter>'</pre></div>
|
230
|
+
<pre class="ruby"><code><span class="linenum">27</span> <span class="ident">mock</span> <span class="punct">=</span> <span class="ident">mock</span><span class="punct">("</span><span class="string">don't talk to me</span><span class="punct">")</span>
|
231
|
+
<span class="linenum">28</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">should_not_receive</span><span class="punct">(</span><span class="symbol">:any_message_at_all</span><span class="punct">)</span>
|
232
|
+
<span class="offending"><span class="linenum">29</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">any_message_at_all</span></span>
|
233
|
+
<span class="linenum">30</span> <span class="keyword">end</span></code></pre>
|
234
|
+
</div>
|
235
|
+
</dd>
|
236
|
+
<script type="text/javascript">moveProgressBar('29.4');</script>
|
237
|
+
<dd class="spec pending_fixed">
|
238
|
+
<span class="failed_spec_name">has a bug we need to fix</span>
|
239
|
+
<div class="failure" id="failure_4">
|
240
|
+
<div class="message"><pre>Expected pending 'here is the bug' to fail. No Error was raised.</pre></div>
|
241
|
+
<div class="backtrace"><pre><a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/examples/failing/mocking_example.rb&line=33">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/examples/failing/mocking_example.rb:33</a> :in `block (2 levels) in <top (required)>'
|
242
|
+
<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=51">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb:51</a> :in `block (4 levels) in <module:Formatter>'
|
243
|
+
<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=47">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb:47</a> :in `chdir'
|
244
|
+
<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=47">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb:47</a> :in `block (3 levels) in <module:Formatter>'</pre></div>
|
245
|
+
<pre class="ruby"><code><span class="linenum">31</span>
|
246
|
+
<span class="linenum">32</span> <span class="ident">it</span> <span class="punct">"</span><span class="string">has a bug we need to fix</span><span class="punct">"</span> <span class="keyword">do</span>
|
247
|
+
<span class="offending"><span class="linenum">33</span> <span class="ident">pending</span> <span class="punct">"</span><span class="string">here is the bug</span><span class="punct">"</span> <span class="keyword">do</span></span>
|
248
|
+
<span class="linenum">34</span> <span class="comment"># Actually, no. It's fixed. This will fail because it passes :-)</span>
|
249
|
+
<span class="linenum">35</span> <span class="ident">mock</span> <span class="punct">=</span> <span class="ident">mock</span><span class="punct">("</span><span class="string">Bug</span><span class="punct">")</span></code></pre>
|
250
|
+
</div>
|
251
|
+
</dd>
|
252
|
+
</dl>
|
253
|
+
</div>
|
254
|
+
<div class="example_group">
|
255
|
+
<dl>
|
256
|
+
<dt id="example_group_2">Running specs with --diff</dt>
|
257
|
+
<script type="text/javascript">makeRed('example_group_2');</script>
|
258
|
+
<script type="text/javascript">moveProgressBar('35.2');</script>
|
259
|
+
<dd class="spec failed">
|
260
|
+
<span class="failed_spec_name">should print diff of different strings</span>
|
261
|
+
<div class="failure" id="failure_5">
|
262
|
+
<div class="message"><pre>expected: "RSpec is a\nbehaviour driven development\nframework for Ruby\n",
|
263
|
+
got: "RSpec is a\nbehavior driven development\nframework for Ruby\n" (using ==)
|
264
|
+
Diff:
|
265
|
+
@@ -1,4 +1,4 @@
|
266
|
+
RSpec is a
|
267
|
+
-behaviour driven development
|
268
|
+
+behavior driven development
|
269
|
+
framework for Ruby
|
270
|
+
</pre></div>
|
271
|
+
<div class="backtrace"><pre><a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/examples/failing/diffing_spec.rb&line=13">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/examples/failing/diffing_spec.rb:13</a> :in `block (2 levels) in <top (required)>'
|
272
|
+
<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=51">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb:51</a> :in `block (4 levels) in <module:Formatter>'
|
273
|
+
<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=47">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb:47</a> :in `chdir'
|
274
|
+
<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=47">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb:47</a> :in `block (3 levels) in <module:Formatter>'</pre></div>
|
275
|
+
<pre class="ruby"><code><span class="linenum">11</span><span class="ident">framework</span> <span class="keyword">for</span> <span class="constant">Ruby</span>
|
276
|
+
<span class="linenum">12</span><span class="constant">EOF</span>
|
277
|
+
<span class="offending"><span class="linenum">13</span> <span class="ident">usa</span><span class="punct">.</span><span class="ident">should</span> <span class="punct">==</span> <span class="ident">uk</span></span>
|
278
|
+
<span class="linenum">14</span> <span class="keyword">end</span></code></pre>
|
279
|
+
</div>
|
280
|
+
</dd>
|
281
|
+
<script type="text/javascript">moveProgressBar('41.1');</script>
|
282
|
+
<dd class="spec failed">
|
283
|
+
<span class="failed_spec_name">should print diff of different objects' pretty representation</span>
|
284
|
+
<div class="failure" id="failure_6">
|
285
|
+
<div class="message"><pre>expected <Animal
|
286
|
+
name=bob,
|
287
|
+
species=tortoise
|
288
|
+
>
|
289
|
+
, got <Animal
|
290
|
+
name=bob,
|
291
|
+
species=giraffe
|
292
|
+
>
|
293
|
+
(using .eql?)
|
294
|
+
Diff:
|
295
|
+
@@ -1,5 +1,5 @@
|
296
|
+
<Animal
|
297
|
+
name=bob,
|
298
|
+
-species=tortoise
|
299
|
+
+species=giraffe
|
300
|
+
>
|
301
|
+
</pre></div>
|
302
|
+
<div class="backtrace"><pre><a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/examples/failing/diffing_spec.rb&line=34">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/examples/failing/diffing_spec.rb:34</a> :in `block (2 levels) in <top (required)>'
|
303
|
+
<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=51">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb:51</a> :in `block (4 levels) in <module:Formatter>'
|
304
|
+
<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=47">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb:47</a> :in `chdir'
|
305
|
+
<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb&line=47">/Users/david/projects/ruby/rspec-dev/example_rails_app/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb:47</a> :in `block (3 levels) in <module:Formatter>'</pre></div>
|
306
|
+
<pre class="ruby"><code><span class="linenum">32</span> <span class="ident">expected</span> <span class="punct">=</span> <span class="constant">Animal</span><span class="punct">.</span><span class="ident">new</span> <span class="punct">"</span><span class="string">bob</span><span class="punct">",</span> <span class="punct">"</span><span class="string">giraffe</span><span class="punct">"</span>
|
307
|
+
<span class="linenum">33</span> <span class="ident">actual</span> <span class="punct">=</span> <span class="constant">Animal</span><span class="punct">.</span><span class="ident">new</span> <span class="punct">"</span><span class="string">bob</span><span class="punct">",</span> <span class="punct">"</span><span class="string">tortoise</span><span class="punct">"</span>
|
308
|
+
<span class="offending"><span class="linenum">34</span> <span class="ident">expected</span><span class="punct">.</span><span class="ident">should</span> <span class="ident">eql</span><span class="punct">(</span><span class="ident">actual</span><span class="punct">)</span></span>
|
309
|
+
<span class="linenum">35</span> <span class="keyword">end</span>
|
310
|
+
<span class="linenum">36</span><span class="keyword">end</span></code></pre>
|
311
|
+
</div>
|
312
|
+
</dd>
|
313
|
+
</dl>
|
314
|
+
</div>
|
315
|
+
<div class="example_group">
|
316
|
+
<dl>
|
317
|
+
<dt id="example_group_3">A consumer of a stub</dt>
|
318
|
+
<script type="text/javascript">moveProgressBar('47.0');</script>
|
319
|
+
<dd class="spec passed"><span class="passed_spec_name">should be able to stub methods on any Object</span></dd>
|
320
|
+
</dl>
|
321
|
+
</div>
|
322
|
+
<div class="example_group">
|
323
|
+
<dl>
|
324
|
+
<dt id="example_group_4">A stubbed method on a class</dt>
|
325
|
+
<script type="text/javascript">moveProgressBar('52.9');</script>
|
326
|
+
<dd class="spec passed"><span class="passed_spec_name">should return the stubbed value</span></dd>
|
327
|
+
<script type="text/javascript">moveProgressBar('58.8');</script>
|
328
|
+
<dd class="spec passed"><span class="passed_spec_name">should revert to the original method after each spec</span></dd>
|
329
|
+
<script type="text/javascript">moveProgressBar('64.7');</script>
|
330
|
+
<dd class="spec passed"><span class="passed_spec_name">can stub! and mock the same message</span></dd>
|
331
|
+
</dl>
|
332
|
+
</div>
|
333
|
+
<div class="example_group">
|
334
|
+
<dl>
|
335
|
+
<dt id="example_group_5">A mock</dt>
|
336
|
+
<script type="text/javascript">moveProgressBar('70.5');</script>
|
337
|
+
<dd class="spec passed"><span class="passed_spec_name">can stub!</span></dd>
|
338
|
+
<script type="text/javascript">moveProgressBar('76.4');</script>
|
339
|
+
<dd class="spec passed"><span class="passed_spec_name">can stub! and mock</span></dd>
|
340
|
+
<script type="text/javascript">moveProgressBar('82.3');</script>
|
341
|
+
<dd class="spec passed"><span class="passed_spec_name">can stub! and mock the same message</span></dd>
|
342
|
+
</dl>
|
343
|
+
</div>
|
344
|
+
<div class="example_group">
|
345
|
+
<dl>
|
346
|
+
<dt id="example_group_6">pending example (using pending method)</dt>
|
347
|
+
<script type="text/javascript">makeYellow('example_group_6');</script>
|
348
|
+
<script type="text/javascript">moveProgressBar('88.2');</script>
|
349
|
+
<dd class="spec not_implemented"><span class="not_implemented_spec_name">should be reported as "PENDING: for some reason" (PENDING: for some reason)</span></dd>
|
350
|
+
</dl>
|
351
|
+
</div>
|
352
|
+
<div class="example_group">
|
353
|
+
<dl>
|
354
|
+
<dt id="example_group_7">pending example (with no block)</dt>
|
355
|
+
<script type="text/javascript">makeYellow('example_group_7');</script>
|
356
|
+
<script type="text/javascript">moveProgressBar('94.1');</script>
|
357
|
+
<dd class="spec not_implemented"><span class="not_implemented_spec_name">should be reported as "PENDING: Not Yet Implemented" (PENDING: Not Yet Implemented)</span></dd>
|
358
|
+
</dl>
|
359
|
+
</div>
|
360
|
+
<div class="example_group">
|
361
|
+
<dl>
|
362
|
+
<dt id="example_group_8">pending example (with block for pending)</dt>
|
363
|
+
<script type="text/javascript">makeYellow('example_group_8');</script>
|
364
|
+
<script type="text/javascript">moveProgressBar('100.0');</script>
|
365
|
+
<dd class="spec not_implemented"><span class="not_implemented_spec_name">should have a failing block, passed to pending, reported as "PENDING: for some reason" (PENDING: for some reason)</span></dd>
|
366
|
+
</dl>
|
367
|
+
</div>
|
368
|
+
<script type="text/javascript">document.getElementById('duration').innerHTML = "Finished in <strong>x seconds</strong>";</script>
|
369
|
+
<script type="text/javascript">document.getElementById('totals').innerHTML = "17 examples, 6 failures, 3 pending";</script>
|
370
|
+
</div>
|
371
|
+
</div>
|
372
|
+
</body>
|
373
|
+
</html>
|
@@ -1,13 +1,20 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
unless Spec::Ruby.version.to_f == 1.9
|
2
|
+
require File.dirname(__FILE__) + '/../../spec_helper.rb'
|
3
|
+
unless [/mswin/, /java/].detect{|p| p =~ RUBY_PLATFORM}
|
4
|
+
require 'spec/runner/heckle_runner'
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
describe "Heckler" do
|
7
|
+
it "should run examples on tests_pass?" do
|
8
|
+
sub = Class.new(Spec::Runner::Heckler) do
|
9
|
+
def initialize(klass_name, method_name, rspec_options)
|
10
|
+
@rspec_options = rspec_options
|
11
|
+
end
|
12
|
+
end
|
13
|
+
opts = mock('options')
|
14
|
+
opts.should_receive(:run_examples).and_return(true)
|
15
|
+
heckler = sub.new('klass','method',opts)
|
16
|
+
heckler.tests_pass?
|
17
|
+
end
|
11
18
|
end
|
12
19
|
end
|
13
20
|
end
|
@@ -1,20 +1,5 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/../../spec_helper.rb'
|
2
|
-
require '
|
3
|
-
|
4
|
-
module Custom
|
5
|
-
class ExampleGroupRunner
|
6
|
-
attr_reader :options, :arg
|
7
|
-
def initialize(options, arg)
|
8
|
-
@options, @arg = options, arg
|
9
|
-
end
|
10
|
-
|
11
|
-
def load_files(files)
|
12
|
-
end
|
13
|
-
|
14
|
-
def run
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
2
|
+
require File.dirname(__FILE__) + '/resources/custom_example_group_runner'
|
18
3
|
|
19
4
|
describe "OptionParser" do
|
20
5
|
before(:each) do
|
@@ -73,14 +58,14 @@ describe "OptionParser" do
|
|
73
58
|
end
|
74
59
|
|
75
60
|
it "should print help to stdout if no args and spec_comand?" do
|
76
|
-
Spec.stub!(:spec_command?).and_return(true)
|
61
|
+
Spec::Runner::OptionParser.stub!(:spec_command?).and_return(true)
|
77
62
|
options = parse([])
|
78
63
|
@out.rewind
|
79
64
|
@out.read.should match(/Usage: spec \(FILE\|DIRECTORY\|GLOB\)\+ \[options\]/m)
|
80
65
|
end
|
81
66
|
|
82
67
|
it "should not print help to stdout if no args and NOT spec_command?" do
|
83
|
-
Spec.stub!(:spec_command?).and_return(false)
|
68
|
+
Spec::Runner::OptionParser.stub!(:spec_command?).and_return(false)
|
84
69
|
options = parse([])
|
85
70
|
@out.rewind
|
86
71
|
@out.read.should == ""
|
@@ -1,4 +1,5 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../spec_helper
|
1
|
+
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
+
require File.dirname(__FILE__) + '/resources/custom_example_group_runner'
|
2
3
|
|
3
4
|
module Spec
|
4
5
|
module Runner
|
@@ -7,12 +8,17 @@ module Spec
|
|
7
8
|
@err = StringIO.new('')
|
8
9
|
@out = StringIO.new('')
|
9
10
|
@options = Options.new(@err, @out)
|
11
|
+
|
12
|
+
before_suite_parts = []
|
13
|
+
after_suite_parts = []
|
14
|
+
@options.stub!(:before_suite_parts).and_return(before_suite_parts)
|
15
|
+
@options.stub!(:after_suite_parts).and_return(after_suite_parts)
|
10
16
|
end
|
11
17
|
|
12
18
|
after(:each) do
|
13
19
|
Spec::Expectations.differ = nil
|
14
20
|
end
|
15
|
-
|
21
|
+
|
16
22
|
describe "#examples" do
|
17
23
|
it "should default to empty array" do
|
18
24
|
@options.examples.should == []
|
@@ -212,7 +218,7 @@ module Spec
|
|
212
218
|
describe "#load_class" do
|
213
219
|
it "should raise error when not class name" do
|
214
220
|
lambda do
|
215
|
-
@options.
|
221
|
+
@options.__send__(:load_class, 'foo', 'fruit', '--food')
|
216
222
|
end.should raise_error('"foo" is not a valid class name')
|
217
223
|
end
|
218
224
|
end
|
@@ -223,9 +229,24 @@ module Spec
|
|
223
229
|
@options.reporter.options.should === @options
|
224
230
|
end
|
225
231
|
end
|
232
|
+
|
233
|
+
describe "#number_of_examples" do
|
234
|
+
context "when --example is parsed" do
|
235
|
+
it "provides the number of examples parsed instead of the total number of examples collected" do
|
236
|
+
@example_group = Class.new(::Spec::Example::ExampleGroup).describe("Some Examples") do
|
237
|
+
it "uses this example_group 1" do; end
|
238
|
+
it "uses this example_group 2" do; end
|
239
|
+
it "uses this example_group 3" do; end
|
240
|
+
end
|
241
|
+
@options.add_example_group @example_group
|
242
|
+
@options.parse_example("an example")
|
243
|
+
@options.number_of_examples.should == 1
|
244
|
+
end
|
245
|
+
end
|
246
|
+
end
|
226
247
|
|
227
248
|
describe "#add_example_group affecting passed in example_group" do
|
228
|
-
it "runs all examples when options.examples is
|
249
|
+
it "runs all examples when options.examples is empty" do
|
229
250
|
example_1_has_run = false
|
230
251
|
example_2_has_run = false
|
231
252
|
@example_group = Class.new(::Spec::Example::ExampleGroup).describe("Some Examples") do
|
@@ -237,7 +258,7 @@ module Spec
|
|
237
258
|
end
|
238
259
|
end
|
239
260
|
|
240
|
-
@options.examples
|
261
|
+
@options.examples.clear
|
241
262
|
|
242
263
|
@options.add_example_group @example_group
|
243
264
|
@options.run_examples
|
@@ -257,8 +278,6 @@ module Spec
|
|
257
278
|
end
|
258
279
|
end
|
259
280
|
|
260
|
-
@options.examples = []
|
261
|
-
|
262
281
|
@options.add_example_group @example_group
|
263
282
|
@options.run_examples
|
264
283
|
example_1_has_run.should be_true
|
@@ -362,7 +381,7 @@ module Spec
|
|
362
381
|
end
|
363
382
|
|
364
383
|
describe "and the suite fails" do
|
365
|
-
before do
|
384
|
+
before(:each) do
|
366
385
|
@example_group.should_receive(:run).and_return(false)
|
367
386
|
end
|
368
387
|
|