mvcli 0.0.13 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c8df3bbd6ac8b26f4a48b1ed2d9c67a8ef4a8616
4
- data.tar.gz: caff046276e71a1e374b6f58941e5f6a25422c78
3
+ metadata.gz: cb15bdc23646980fbfdea73b3cd1f051467aff7e
4
+ data.tar.gz: 2e38b80f19750bf4d47c8f0cc31ba4a1c138aadb
5
5
  SHA512:
6
- metadata.gz: 72f2bfbd5958be1c910e1fe92d3259a43112e64f83563b837e76b6df153ee27f665406e8b98d336c3e737e8860dd08275d87717dd3112488774b3e04bd54289a
7
- data.tar.gz: 70fd38e776ff6c3e8c3ad4b6b49efb2f96143366eadadd4416577a45ceb51d07c0cc009f4ba82141eb822b1966fc27c7d747d246080ef5ad7bd80b7bb34de4e0
6
+ metadata.gz: dccdfd0d6bef05bdab748537d0f2679441b8d3039865329fae20509c4546fdbf72c47cf8577b6d7aaff959aa902b29db1acef5778add753d112395fb9bbf58b7
7
+ data.tar.gz: 923fc371652f94527547153d65a6b9ddb85042641b70c656b8aa940b6283b1a8dc8545149450d81b33866699dc78339598e23c42f9a5237c64ae7ce1960ed73f
data/lib/mvcli/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module MVCLI
2
- VERSION = "0.0.13"
2
+ VERSION = "0.0.14"
3
3
  end
@@ -2,6 +2,8 @@ require "spec_helper"
2
2
  require "mvcli/router"
3
3
 
4
4
  describe "MVCLI::Router" do
5
+ use_natural_assertions
6
+
5
7
  Given(:Router) {MVCLI::Router}
6
8
  Given(:actions) {mock(:Actions)}
7
9
  Given(:router) {self.Router.new actions}
@@ -20,36 +22,36 @@ describe "MVCLI::Router" do
20
22
  context "with a route matched to an action" do
21
23
  Given {router.match 'login' => 'logins#create'}
22
24
  When {invoke 'login'}
23
- Then {@action.should eql 'logins#create'}
24
- And {@command.should_not be_nil}
25
- Then {@command.argv.should eql ['login']}
25
+ Then { @action == 'logins#create' }
26
+ And { not @command.nil? }
27
+ Then { @command.argv == ['login'] }
26
28
  end
27
29
 
28
30
  context "when there are command line options, it does not interfere" do
29
- Given {router.match 'login' => 'logins#create'}
30
- When {invoke 'login --then --go-away -f 6 -p'}
31
- Then {@command.should_not be_nil}
31
+ Given { router.match 'login' => 'logins#create' }
32
+ When { invoke 'login --then --go-away -f 6 -p' }
33
+ Then { not @command.nil? }
32
34
  end
33
35
 
34
36
  context "with a route matched to a block" do
35
- Given {router.match bam: ->(command) {@command = command}}
36
- When {invoke 'bam'}
37
- Then {@command.argv.should eql ['bam']}
37
+ Given { router.match bam: ->(command) {@command = command} }
38
+ When { invoke 'bam' }
39
+ Then { @command.argv == ['bam'] }
38
40
  end
39
41
 
40
42
  context "with a route with captures" do
41
43
  Given {router.match 'show loadbalancer :id' => 'loadbalancers#show'}
42
44
  When {invoke 'show loadbalancer 6'}
43
- Then {@action.should eql 'loadbalancers#show'}
44
- And {@command.argv == ['show' 'loadbalancer' '6']}
45
- And {@bindings[:id].should eql '6'}
45
+ Then {@action == 'loadbalancers#show'}
46
+ And {@command.argv == ['show', 'loadbalancer', '6']}
47
+ And {@bindings[:id] == '6'}
46
48
  end
47
49
 
48
50
  context "with macros" do
49
51
  Given { router.macro /(-h|--help) (.*)/ => "help \\2" }
50
52
  Given { router.match "help me" => "help#me"}
51
53
  When { invoke "--help me" }
52
- Then { @action.should eql 'help#me' }
54
+ Then { @action == 'help#me' }
53
55
  end
54
56
 
55
57
  def invoke(route = '')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mvcli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Lowell