28 Commits

Author SHA1 Message Date
Thibault Jouan
58f3a7223e Declare arguments explicitly in actions specs 2014-10-09 20:05:31 +00:00
Thibault Jouan
ef7259fab2 Move #to_s spec from shared actions to Action 2014-10-09 19:10:51 +00:00
Thibault Jouan
e7a46cecd1 Remove shared action specs on attr_reader 2014-10-08 23:43:08 +00:00
Thibault Jouan
a84b34b7ca Support `mkdir' status attributes 2014-10-08 22:36:27 +00:00
Thibault Jouan
1e3cd696c8 Use a verifying double for remote FS in specs 2014-09-25 20:55:13 +00:00
Thibault Jouan
563bf9cccf Implement action arguments logging 2014-09-17 00:24:31 +00:00
Thibault Jouan
db91eb06cd Forward standard error stream from remote execution 2014-07-24 17:38:13 +00:00
Thibault Jouan
a866d2a42f Update TestEnvHelpers for rspec 2.99.x 2014-07-01 16:59:49 +00:00
Thibault Jouan
e423a66d5c Fix coding standards in spec 2014-06-27 17:32:03 +00:00
Thibault Jouan
8291f1bcfd Implement verbose mode 2014-05-25 12:14:22 +00:00
Thibault Jouan
4d7e11ceeb Patch net-ssh story helpers for 2.8.0 2014-03-31 23:31:54 +00:00
Thibault Jouan
b9976464a4 Remove Net::SSH story helpers usage in FS specs 2014-03-05 06:47:55 +00:00
Thibault Jouan
db3644a3e6 Write output from `sh' task action directly:
* Accept output as argument in Remote#execute;
* Modify ShellCommand so that env output is directly handled.
2014-03-05 06:06:42 +00:00
Thibault Jouan
f45d0b5a20 Modify Remote::FS interface:
* Accept SFTP session in FS constructor;
* Modify Remote to build the session required by FS;
* Change TestEnvHelpers#build_remote in order to provided a test double
  as the remote FS.
2014-03-05 00:07:59 +00:00
Thibault Jouan
fcba1a5c0b Implement rspec TestEnvHelpers:
Allow use of our test environment, with a mocked remote and convenient
methods to write more concise expectations.

  #env, builds and returns a memoized test environment (with mocked
  remote)

  #output, returns env output as a string

  #remote_fs, returns env remote fs

  #expect_execution, setup a remote command execution expectation
2014-03-04 23:24:05 +00:00
Thibault Jouan
91637ca631 Refactor tests specs with shared examples 2014-02-10 17:33:48 +00:00
Thibault Jouan
4624a81100 Refactor actions specs with shared examples 2014-02-10 16:49:17 +00:00
Thibault Jouan
88d5ab68b7 Remove TestsHelpers module (was used in specs) 2014-01-19 17:39:14 +00:00
Thibault Jouan
892a9862fc Implement `file_write' action 2013-12-20 06:26:21 +00:00
Thibault Jouan
ef0307fbb5 Improve small details in specs:
* Fix coding standards;
* Simplify some expectations (eq instead of be matcher);
* Expect identity on block instead of calling;
* Change some before call as oneliners;
* Avoid shadowing variable names;
* Improve wording where needed.
2013-12-19 22:46:56 +00:00
Thibault Jouan
35621e1f5f Implement condition DSL negated test prefix (no_*)
* Allow no_* to be used for every tests in condition DSL:
  condition { no_has_env :shell, '/bin/sh' };
* Modify Test constructor to accept negated: named argument, implement
  #negated? and #pass?;
* Rename #success? to #verify in all test classes.
2013-12-19 20:22:44 +00:00
Thibault Jouan
8531c49e6d Implement NetSSHStoryHelpers#sftp_story 2013-09-26 00:28:39 +00:00
Thibault Jouan
0529fab3c2 Import Net::SSH::Test::Channel code from net-sftp:
This class is included in net-ssh, but net-sftp adds some new methods
that we need for our tests. This code resides in net-sftp test helper,
and can't be required dynamicaly, this change adds a copy of the code we
need, hardcoded in NetSSHStoryHelpers.
2013-09-26 00:28:39 +00:00
Thibault Jouan
ed99c191e0 Build conditions with DSL evaluated tests:
In Condition:

  * Modify constructor to accepts tests and a default return value;
  * Implement #met?;
  * Modify #! so that it return the negated value returned by #met?.

  In Condition::DSL:

  * Modify .evaluate to build the condition with tests and the value
    returned by a the evaluated condition block.

  Add a basic Test base class, with env and arguments as attributes.

  Add some spec helpers to build some easily testable kind of Test
instances (as test doubles).
2013-08-18 00:29:36 +00:00
Thibault Jouan
cff122432b Refactor Net::SSH spec helpers definition and usages 2013-08-06 17:29:45 +00:00
Thibault Jouan
c3737e738e Refactor trap_exit spec helper usages 2013-08-01 22:51:41 +00:00
Thibault Jouan
65643e065e Fix fixtures path in rspec fixtures helpers 2013-07-28 18:36:04 +00:00
Thibault Jouan
f0d90c96e9 Add rspec fixtures helpers 2013-07-27 18:20:44 +00:00