vedeu 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +21 -2
- data/Rakefile +8 -0
- data/bin/vedeu +1 -1
- data/config/cucumber.yml +8 -0
- data/features/getting_started.feature +10 -0
- data/features/step_definitions/vedeu_steps.rb +11 -0
- data/features/support/env.rb +12 -0
- data/lib/vedeu.rb +30 -9
- data/lib/vedeu/application.rb +1 -1
- data/lib/vedeu/launcher.rb +26 -0
- data/lib/vedeu/output/colour.rb +1 -1
- data/lib/vedeu/output/compositor.rb +9 -6
- data/lib/vedeu/output/directive.rb +1 -1
- data/lib/vedeu/output/geometry.rb +1 -1
- data/lib/vedeu/output/position.rb +2 -2
- data/lib/vedeu/output/style.rb +1 -1
- data/lib/vedeu/output/wordwrap.rb +2 -1
- data/lib/vedeu/process/event_loop.rb +2 -2
- data/lib/vedeu/process/input.rb +30 -0
- data/lib/vedeu/repository/command.rb +32 -0
- data/lib/vedeu/repository/command_repository.rb +27 -0
- data/lib/vedeu/{process → repository}/dummy_command.rb +2 -2
- data/lib/vedeu/repository/dummy_interface.rb +4 -0
- data/lib/vedeu/repository/interface.rb +52 -0
- data/lib/vedeu/repository/interface_repository.rb +49 -0
- data/lib/vedeu/repository/repository.rb +35 -0
- data/lib/vedeu/repository/storage.rb +46 -0
- data/lib/vedeu/support/terminal.rb +5 -6
- data/lib/vedeu/version.rb +1 -1
- data/test/lib/vedeu/application_test.rb +1 -1
- data/test/lib/vedeu/output/compositor_test.rb +15 -13
- data/test/lib/vedeu/output/directive_test.rb +1 -1
- data/test/lib/vedeu/output/position_test.rb +1 -1
- data/test/lib/vedeu/process/event_loop_test.rb +2 -3
- data/test/lib/vedeu/process/input_test.rb +19 -0
- data/test/lib/vedeu/repository/command_repository_test.rb +55 -0
- data/test/lib/vedeu/repository/command_test.rb +39 -0
- data/test/lib/vedeu/repository/interface_repository_test.rb +71 -0
- data/test/lib/vedeu/repository/interface_test.rb +65 -0
- data/test/lib/vedeu/repository/repository_test.rb +88 -0
- data/test/lib/vedeu/repository/storage_test.rb +50 -0
- data/test/test_helper.rb +8 -0
- data/vedeu.gemspec +3 -0
- metadata +75 -21
- data/lib/vedeu/interface/dummy_interface.rb +0 -14
- data/lib/vedeu/interface/interface.rb +0 -57
- data/lib/vedeu/interface/interfaces.rb +0 -66
- data/lib/vedeu/process/command.rb +0 -51
- data/lib/vedeu/process/commands.rb +0 -35
- data/test/lib/vedeu/interface/dummy_test.rb +0 -22
- data/test/lib/vedeu/interface/interface_test.rb +0 -45
- data/test/lib/vedeu/interface/interfaces_test.rb +0 -108
- data/test/lib/vedeu/process/command_test.rb +0 -48
- data/test/lib/vedeu/process/commands_test.rb +0 -56
- data/test/lib/vedeu/process/dummy_command_test.rb +0 -16
@@ -1,56 +0,0 @@
|
|
1
|
-
require_relative '../../../test_helper'
|
2
|
-
|
3
|
-
module Vedeu
|
4
|
-
describe Commands do
|
5
|
-
let(:described_class) { Commands }
|
6
|
-
|
7
|
-
describe '.define' do
|
8
|
-
let(:subject) { described_class.define }
|
9
|
-
|
10
|
-
context 'when a block is given' do
|
11
|
-
let(:subject) { described_class.define { :nil } }
|
12
|
-
|
13
|
-
it 'yields the block' do
|
14
|
-
subject.must_be_instance_of(Symbol)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
context 'when a block is not given' do
|
19
|
-
it { subject.must_be_instance_of(Module) }
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
describe '.execute' do
|
24
|
-
let(:subject) { described_class.execute(command) }
|
25
|
-
let(:command) {}
|
26
|
-
|
27
|
-
context 'when the command does not exist' do
|
28
|
-
it { subject.must_be_instance_of(NilClass) }
|
29
|
-
end
|
30
|
-
|
31
|
-
context 'when the command exists' do
|
32
|
-
let(:command) { "exit" }
|
33
|
-
|
34
|
-
before { Exit.stubs(:dispatch).returns(true) }
|
35
|
-
|
36
|
-
it { subject.must_be_instance_of(TrueClass) }
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
describe '.list' do
|
41
|
-
let(:subject) { described_class.list }
|
42
|
-
|
43
|
-
it { subject.must_be_instance_of(String) }
|
44
|
-
end
|
45
|
-
|
46
|
-
describe '.add' do
|
47
|
-
let(:subject) { described_class.add(command_name, command_klass, args, options) }
|
48
|
-
let(:command_name) { "some_name" }
|
49
|
-
let(:command_klass) { DummyCommand }
|
50
|
-
let(:args) { [] }
|
51
|
-
let(:options) { {} }
|
52
|
-
|
53
|
-
it { subject.must_be_instance_of(Hash) }
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
require_relative '../../../test_helper'
|
2
|
-
|
3
|
-
module Vedeu
|
4
|
-
describe DummyCommand do
|
5
|
-
let(:described_class) { DummyCommand }
|
6
|
-
let(:subject) { described_class.new }
|
7
|
-
|
8
|
-
it { subject.must_be_instance_of(DummyCommand) }
|
9
|
-
|
10
|
-
describe '.dispatch' do
|
11
|
-
let(:subject) { described_class.dispatch }
|
12
|
-
|
13
|
-
it { subject.must_be_instance_of(String) }
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|