cancun 0.1.1 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/cancun/test.rb CHANGED
@@ -28,6 +28,9 @@ class Cancun
28
28
  @output << @output_read.dup.read_nonblock(4096) rescue Errno::EAGAIN
29
29
  @output
30
30
  end
31
+ def execute!(&cmd)
32
+ TestCase.new(self).execute!(&cmd)
33
+ end
31
34
 
32
35
 
33
36
  class TestCase
@@ -40,7 +43,10 @@ class Cancun
40
43
  self
41
44
  end
42
45
 
43
- def output
46
+ def execute!(&block)
47
+ execute(&block)
48
+ run
49
+ sleep 0.01
44
50
  end
45
51
 
46
52
  def and_type(*args)
@@ -1,3 +1,3 @@
1
1
  class Cancun
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -2,13 +2,22 @@ require 'spec_helper'
2
2
 
3
3
  describe 'cancun spec' do
4
4
  include Cancun::Test
5
+
5
6
  before{ init_cancun_test }
6
7
 
7
- it 'works for highline' do
8
+ it 'should let you type args' do
8
9
  execute do
9
10
  Foo.new.salute
10
11
  end.and_type 'bonzo'
11
12
  expect(output).to include('Hi bonzo')
12
13
  end
14
+
15
+ it 'should let you execute without typing' do
16
+ execute! do
17
+ Foo.new.salute
18
+ end
19
+ expect(output).to include('what is your name?')
20
+ end
13
21
  end
14
22
 
23
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cancun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: