hobby-test 0.0.2 → 0.0.3

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: 4a384dfdc98bfcbaf05e4d60a9555ecad3ad1ed1
4
- data.tar.gz: ad4976cbbf499a72cc67adcc8e02044869ce2e44
3
+ metadata.gz: 41d3a46cd1003417175fef9910b7983f1d755b4f
4
+ data.tar.gz: a93d9a3cf7e609d21c3f65b78e18b14bb96245a9
5
5
  SHA512:
6
- metadata.gz: b3836b972568d143e1713e720f93dab9fa04cb8cdc710e66b4ddb87b9dff865ec5eea9a98a8dd7f61d377c2959d25d4e2389071aac6d0caf96bd377f229345b1
7
- data.tar.gz: 7abdd424b0b9b2ef3e0f27f9a218a1b21b54ceec6c868193fd778733de94141348c282995e04da3d9137705b61396b70cd2c4e359d7f75273f7ecc8154783a7f
6
+ metadata.gz: 6e695d0c7f351339dc0a1038653e5b1d72e6b239a378f1daa4d9e5c44821dddb18acf65a05ecbca5b97c42ec5e4867046384ef6ee227409f7607321d98290124
7
+ data.tar.gz: 51b35c5e433319f648a4fdaa45c27b0962a2064a442527f313e133dc6322b3c43a5454f5b3e5913a7ba80279d74825909576bd53d732d59e013d19d84b664f39
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |g|
2
2
  g.name = 'hobby-test'
3
3
  g.files = `git ls-files`.split($/)
4
- g.version = '0.0.2'
4
+ g.version = '0.0.3'
5
5
  g.summary = 'A way to test HTTP exchanges via YAML specifications'
6
6
  g.authors = ['Anatoly Chernow']
7
7
 
@@ -11,8 +11,16 @@ require 'hobby/test/report'
11
11
 
12
12
  module Hobby
13
13
  class Test
14
- def initialize file
15
- @exchanges = (YAML.load_file file).map &Exchange
14
+ def self.from_file string
15
+ new YAML.load_file string
16
+ end
17
+
18
+ def self.from_string string
19
+ new YAML.load string
20
+ end
21
+
22
+ def initialize array_of_hashes
23
+ @exchanges = array_of_hashes.map &Exchange
16
24
  end
17
25
 
18
26
  def [] address
@@ -3,7 +3,7 @@ require 'helper'
3
3
  describe 'passing and failing YAML specifications' do
4
4
  Dir["spec/yml/**/*.yml"].each do |path|
5
5
  name = path.split('/').last
6
- test = Hobby::Test.new path
6
+ test = Hobby::Test.from_file path
7
7
 
8
8
  if path.include? 'passing'
9
9
  it "passing #{name}" do
@@ -21,7 +21,7 @@ describe Hobby::Test do
21
21
  end
22
22
 
23
23
  it 'in case of success' do
24
- test = described_class.new 'spec/yml/passing/0.yml'
24
+ test = described_class.from_file 'spec/yml/passing/0.yml'
25
25
  report = test['http://localhost:8080']
26
26
  assert { report.ok? }
27
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hobby-test
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anatoly Chernow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-21 00:00:00.000000000 Z
11
+ date: 2016-12-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon