Comments (8)
I think Perl built in functions can be mocked almost as easily as a module function, but the real benefit of a CAF wrapper is that the component author does not have to think about NoAction support -- it's just part of the library.
from caf.
It was my point in fact! Provide an API that handles mocking transparently for the component author, without any specific code, variable or whatever. I imagine that most of the things I mentioned will be very simple in term of implementation.
from caf.
This is unlikely to happen in the 14.12 cycle...
from caf.
Or the 15.4 cycle...
from caf.
Or the 15.6 cycle...
from caf.
@ned21 you can't mock the perl builtins -f
etc. Other nice thing would be integration with Test::Quattor
, so when you fake the contents of a file with set_file_contents
, a file existence test should report this fake file as being present (and the whole subtree should be testable as exsting directories).
i'm willing to do some effort here, but i need something more than just filestatus, i need some basics like
LC::Check::_unlink
with directory support- existence checks for directory (-d), file (-f || -l) or anything (-e || -l)
- mkdir (also for mocking)
this can all go in one module imho, but it will need a better name. or more than one module.
i would also need some advise how reporting would be handled (do we throw errors? log errors? store error message in some magic exported variable?)
from caf.
see also
- quattor/configuration-modules-core#648
- work done in https://github.com/quattor/configuration-modules-core/pull/615/files#diff-03b83223101921d4405f8416363c3a20R359
from caf.
Closing this issue after #142 and #255.
from caf.
Related Issues (20)
- CAF::Reporter struct logging fails on el5 due to missing strict TT mode HOT 2
- CAF::Path documentation: methods should be in alphabetical order or grouped in sections
- CAF::FileWriter Can't call method "can" on unblessed reference at line 353
- filewriter_notmocked.t fails on SL6 HOT 1
- Unittests on el5 fail due to perl warnings HOT 1
- FileWriter: confusing same message with `cancel` and `close` with save=0
- CAF::FileEditor from source broken HOT 3
- CAF::FileWriter: reported diff does not end up in verbose logfile HOT 1
- CAF::FileWriter default permissions HOT 5
- CAF/LC default permissions HOT 1
- CAF::Process output that ends up on stdout is not part of logfile with verbose_logfile
- CAF::Service: Providing restart-if-running (conditional restart) functionality. HOT 4
- CAF::Process: Include an option to execute the command as an specific user HOT 1
- CAF::Process: Include sensitive option HOT 5
- CAF::Process supports shell option HOT 9
- Filewriter: modify permissions when content is unmodified HOT 3
- Problems with #258 HOT 2
- CAF::FileWriter TODO from pod - drop LC::*
- CAF::FileWriter should use external diff command for large files
- CAF::Process allow environment to be specified
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from caf.