Skip to content

Commit a44e3d0

Browse files
committed
Fix the fenced code in the Ruby tutorial.
1 parent ad387d3 commit a44e3d0

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed

testing-with-tap/ruby.md

+20-22
Original file line numberDiff line numberDiff line change
@@ -7,41 +7,39 @@ title: Testing with Ruby
77

88
Testing with Ruby is pretty easy, however, there is a lesser known Ruby program, that produces TAP output (on demand). This handy program is [bacon](http://github.com/chneukirchen/bacon/tree/master). You can install it using the RubyGems Ruby package management system. Just do (possibly as a privileged user):
99

10-
```
11-
# gem install bacon
10+
```bash
11+
$ gem install bacon
1212
```
1313

1414
Now you can create tests. Create a Ruby file test.rb (or something like that):
1515

16-
```
17-
18-
describe "a example test suite" do
19-
it "should consider true as the truth" do
20-
true.should.be.true
21-
end
22-
23-
it "should consider false as the truth, too" do
24-
false.should.be.true
25-
end
16+
```ruby
17+
describe "a example test suite" do
18+
it "should consider true as the truth" do
19+
true.should.be.true
2620
end
2721

22+
it "should consider false as the truth, too" do
23+
false.should.be.true
24+
end
25+
end
2826
```
2927

3028
Once you created your this file, you can issue the command
3129

32-
```
30+
```bash
3331
$ bacon test.rb --tap
3432
```
3533

3634
which, in turn, produces the following TAP output (Version 12)
3735

3836
```
39-
ok 1 - should consider true as the truth
40-
not ok 2 - should consider false as the truth, too: FAILED
41-
# Bacon::Error: false.true?() failed
42-
# ./test.rb:7: a example test suite - should consider false as the truth, too
43-
# ./test.rb:6
44-
# ./test.rb:1
45-
1..2
46-
# 2 tests, 2 assertions, 1 failures, 0 errors
47-
```
37+
ok 1 - should consider true as the truth
38+
not ok 2 - should consider false as the truth, too: FAILED
39+
# Bacon::Error: false.true?() failed
40+
# ./test.rb:7: a example test suite - should consider false as the truth, too
41+
# ./test.rb:6
42+
# ./test.rb:1
43+
1..2
44+
# 2 tests, 2 assertions, 1 failures, 0 errors
45+
```

0 commit comments

Comments
 (0)