Skip to content

Commit 241da0a

Browse files
committed
More info on GitHub pages website
1 parent 08e14ac commit 241da0a

File tree

2 files changed

+89
-9
lines changed

2 files changed

+89
-9
lines changed

gh-pages/assets/css/style.css

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abb
1111
.hidden { display: none; }
1212

1313
/* Spacing */
14-
.post h1, h3, h4, h5, p, .post-body ul, #post-list li, pre {
14+
.post h1, h3, h4, h5, .post-body ul, #post-list li {
1515
margin-bottom: 20px;
1616
}
1717

@@ -35,7 +35,14 @@ h1 {
3535
h2 {
3636
font: bold 21px/1.4em Helvetica, sans-serif;
3737
color: #333;
38-
margin-bottom: 6px;
38+
margin-bottom: 1em;
39+
margin-top:1em;
40+
}
41+
42+
#wrapper h2 {
43+
margin-bottom: .75em;
44+
margin-top: .5em;
45+
3946
}
4047

4148
.profile #wrapper {
@@ -47,7 +54,7 @@ h2 {
4754
.profile #header {
4855
border-bottom: 1px solid #eee;
4956
margin-bottom: 28px;
50-
padding-bottom: 32px;
57+
padding-bottom: 30px;
5158
text-align: center;
5259
position: relative;
5360
}
@@ -78,7 +85,7 @@ h2 {
7885
}
7986

8087
nav.main-nav {
81-
padding: 25px 20px 0;
88+
padding: 0 20px 0;
8289

8390
/*max-width: 600px;*/
8491
/*width:100%;*/
@@ -119,6 +126,10 @@ nav.main-nav a.cta {
119126
padding: 0px 40px 20px 40px;
120127
}
121128

129+
#wrapper p {
130+
padding-bottom: 1em;
131+
}
132+
122133
.home #avatar {
123134
float: right;
124135
width: 40px;
@@ -151,8 +162,21 @@ a,
151162
transition: all 0.15s ease;
152163
}
153164

154-
ul { margin:0; padding:0; }
155-
li { list-style-type:circle; list-style-position:inside; }
165+
.home ul {
166+
/*padding-top: 10px;*/
167+
padding-left: 3em;
168+
text-indent: -1em;
169+
/*padding-bottom: 20px;*/
170+
}
171+
172+
.home li {
173+
list-style-position:inside;
174+
line-height: 1.7;
175+
}
176+
177+
li p {
178+
margin-left:10px;
179+
}
156180

157181
/* Line Height */
158182
#post-body, p { line-height:1.7; }
@@ -308,7 +332,10 @@ pre {
308332
font-size: 13px;
309333
line-height: 1.5em;
310334
font-weight: 500;
311-
color: #d0d4d7;
335+
}
336+
337+
pre.highlight {
338+
margin-bottom: 1em;
312339
}
313340

314341
table {
@@ -661,4 +688,4 @@ h2.month {
661688
.block ul li {
662689
display: inline;
663690
}
664-
}
691+
}

gh-pages/index.md

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,59 @@ layout: default
33
profile: true
44
---
55

6-
C++Spec is a behavior-driven development library for C++ with an RSpec-inspired DSL.
6+
C++Spec is a behavior-driven development library for C++ with an RSpec-inspired DSL. Designed with ease of use and rapid prototyping in mind, C++Spec offers an alternative to traditional testing libraries and frameworks. Some of the core concepts:
7+
8+
- A clean, readable syntax
9+
- As few macros as possibles
10+
- Use as a library, not a framework
11+
- Easily extensible with custom matchers.
12+
- Support for the RSpec and Jasmine constructs you'd expect, such as describe, context, it, expect, and let.
13+
- Can automatically generate documentation strings based on your tests
14+
15+
## An example:
16+
17+
```c++
18+
describe_a <std::list<int>>
19+
int_list_spec("A list of ints", {1,2,3}, $ {
20+
it("is doubly-linked", _ {
21+
expect(subject.front()).to_equal(1);
22+
expect(subject.back()).to_equal(3);
23+
});
24+
25+
it(_{ is_expected().to_include(6); });
26+
it(_{ is_expected().to_include({1,2,3}); });
27+
it(_{ is_expected().not_().to_include(4); });
28+
});
29+
```
30+
31+
<p style="padding-bottom:0;margin-bottom:-.5em;">Using the Verbose formatter this outputs:</p>
32+
<pre class="highlight" style="padding-top:0;padding-bottom:0;margin-bottom:-.5em">
33+
<code>
34+
<span>A list of ints</span>
35+
<span class="sr"> is doubly-linked</span>
36+
<span class="s1"> should include 6</span>
37+
<span class="s1">expected [1,2,3] to include 6</span>
38+
<span class="sr"> should include 1, 2, and 3</span>
39+
<span class="sr"> should not include 4</span>
40+
</code>
41+
</pre>
42+
43+
## Usage:
44+
45+
Download the [header file]() and put it in your project either alongside your tests or in a folder that is in your `INCLUDE` path. Then, simply `#include "cppspec.hpp"` and you're ready to go.
46+
47+
## How does it work?
48+
49+
C++Spec utilizes templated classes and functions as well as C++14 features in order to automatically deduce the types of your objects and construct your tests.
50+
51+
Lambdas are passed to functions (such as `context` and `it`) in order to build an execution tree at runtime. A formatter object visits each node when the tests are run and prints the status of the tests and any errors.
52+
53+
## I'm getting really long errors. What's going on?
54+
55+
Due to how the library is constructed with both templates and auto-type lambdas, error messages from the compiler can be difficult to understand. Errors also tend to cascade and make the enclosing objects also fail, further obfuscating what's actually going wrong.
56+
57+
Usually, the only information you want is the actual error, not all of the template substitution notes. You can reduce the template backtrace by using the flag `-ftemplate-backtrace-limit=1` when compiling with GCC and Clang.
58+
59+
760
861
{% include footer.html %}

0 commit comments

Comments
 (0)