Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 80 lines (70 sloc) 3.281 kB
cb3a2ac @luislavena Added Cucumber features and misc items.
luislavena authored
1 Feature: Compile C code into Ruby extensions.
2
3 In order to automate compilation process.
4 As a Gem developer.
5 I want rake tasks compile source code for me.
6
4fcf400 @luislavena Updated compile feature to match and cover required acceptance.
luislavena authored
7 Scenario: compile single extension
cb3a2ac @luislavena Added Cucumber features and misc items.
luislavena authored
8 Given a safe project directory
ff6ad43 @luislavena Updated wording for compilation feature.
luislavena authored
9 And a extension named 'extension_one'
cb3a2ac @luislavena Added Cucumber features and misc items.
luislavena authored
10 And 'tmp' folder is deleted
11 When rake task 'compile' is invoked
4fcf400 @luislavena Updated compile feature to match and cover required acceptance.
luislavena authored
12 Then rake task 'compile' succeeded
13 And binary extension 'extension_one' do exist in 'lib'
303983b @luislavena Better compiler feature wording.
luislavena authored
14 And 'tmp' folder is created
cb3a2ac @luislavena Added Cucumber features and misc items.
luislavena authored
15
11ce92d @luislavena Add some test harness to latest changes
luislavena authored
16 Scenario: compile an extension with extra options
17 Given a safe project directory
18 And a extension named 'extension_one'
19 And 'tmp' folder is deleted
20 When rake task 'compile -- --with-opt-dir=/opt/local' is invoked
21 Then rake task 'compile -- --with-opt-dir=/opt/local' succeeded
22 And output of rake task 'compile -- --with-opt-dir=/opt/local' contains /with-opt-dir/
23
4fcf400 @luislavena Updated compile feature to match and cover required acceptance.
luislavena authored
24 Scenario: not recompile unmodified extension
cb3a2ac @luislavena Added Cucumber features and misc items.
luislavena authored
25 Given a safe project directory
ff6ad43 @luislavena Updated wording for compilation feature.
luislavena authored
26 And a extension named 'extension_one'
4fcf400 @luislavena Updated compile feature to match and cover required acceptance.
luislavena authored
27 And I've already successfully executed rake task 'compile'
28 And not changed any file since
cb3a2ac @luislavena Added Cucumber features and misc items.
luislavena authored
29 When rake task 'compile' is invoked
4fcf400 @luislavena Updated compile feature to match and cover required acceptance.
luislavena authored
30 Then rake task 'compile' succeeded
aa7166b @luislavena Only trigger step when 'gcc' or 'cl' compilers are executed
luislavena authored
31 And output of rake task 'compile' do not contain /gcc|cl/
cb3a2ac @luislavena Added Cucumber features and misc items.
luislavena authored
32
31882dd @luislavena Last tweak to compilation feature (I promise).
luislavena authored
33 Scenario: recompile extension when source is modified
34 Given a safe project directory
ff6ad43 @luislavena Updated wording for compilation feature.
luislavena authored
35 And a extension named 'extension_one'
4fcf400 @luislavena Updated compile feature to match and cover required acceptance.
luislavena authored
36 And I've already successfully executed rake task 'compile'
31882dd @luislavena Last tweak to compilation feature (I promise).
luislavena authored
37 When touching 'source.c' file of extension 'extension_one'
38 And rake task 'compile' is invoked
4fcf400 @luislavena Updated compile feature to match and cover required acceptance.
luislavena authored
39 Then rake task 'compile' succeeded
40 And output of rake task 'compile' contains /extension_one/
31882dd @luislavena Last tweak to compilation feature (I promise).
luislavena authored
41
4fcf400 @luislavena Updated compile feature to match and cover required acceptance.
luislavena authored
42 Scenario: compile multiple extensions
cb3a2ac @luislavena Added Cucumber features and misc items.
luislavena authored
43 Given a safe project directory
ff6ad43 @luislavena Updated wording for compilation feature.
luislavena authored
44 And a extension named 'extension_one'
45 And a extension named 'extension_two'
cb3a2ac @luislavena Added Cucumber features and misc items.
luislavena authored
46 And 'tmp' folder is deleted
47 When rake task 'compile' is invoked
4fcf400 @luislavena Updated compile feature to match and cover required acceptance.
luislavena authored
48 Then rake task 'compile' succeeded
49 And binary extension 'extension_one' do exist in 'lib'
cb3a2ac @luislavena Added Cucumber features and misc items.
luislavena authored
50 And binary extension 'extension_two' do exist in 'lib'
303983b @luislavena Better compiler feature wording.
luislavena authored
51 And 'tmp' folder is created
cb3a2ac @luislavena Added Cucumber features and misc items.
luislavena authored
52
4fcf400 @luislavena Updated compile feature to match and cover required acceptance.
luislavena authored
53 Scenario: compile one extension instead of all present
cb3a2ac @luislavena Added Cucumber features and misc items.
luislavena authored
54 Given a safe project directory
ff6ad43 @luislavena Updated wording for compilation feature.
luislavena authored
55 And a extension named 'extension_one'
56 And a extension named 'extension_two'
cb3a2ac @luislavena Added Cucumber features and misc items.
luislavena authored
57 When rake task 'compile:extension_one' is invoked
4fcf400 @luislavena Updated compile feature to match and cover required acceptance.
luislavena authored
58 Then rake task 'compile:extension_one' succeeded
59 And output of rake task 'compile:extension_one' do not contain /extension_two/
60 And binary extension 'extension_one' do exist in 'lib'
61 And binary extension 'extension_two' do not exist in 'lib'
187ebaf @luislavena ExtensionTask now generated clean and clobber tasks.
luislavena authored
62
63 Scenario: removing temporary files
64 Given a safe project directory
ff6ad43 @luislavena Updated wording for compilation feature.
luislavena authored
65 And a extension named 'extension_one'
187ebaf @luislavena ExtensionTask now generated clean and clobber tasks.
luislavena authored
66 And I've already successfully executed rake task 'compile'
67 When rake task 'clean' is invoked
68 Then rake task 'clean' succeeded
69 And binary extension 'extension_one' do exist in 'lib'
392af91 @luislavena Corrected steps for cleanup.
luislavena authored
70 And no left over from 'extension_one' remains in 'tmp'
187ebaf @luislavena ExtensionTask now generated clean and clobber tasks.
luislavena authored
71
72 Scenario: clobbering binary and temporary files
73 Given a safe project directory
ff6ad43 @luislavena Updated wording for compilation feature.
luislavena authored
74 And a extension named 'extension_one'
187ebaf @luislavena ExtensionTask now generated clean and clobber tasks.
luislavena authored
75 And I've already successfully executed rake task 'compile'
76 When rake task 'clobber' is invoked
77 Then rake task 'clobber' succeeded
78 And binary extension 'extension_one' do not exist in 'lib'
79 And 'tmp' folder do not exist
Something went wrong with that request. Please try again.