Skip to content

Commit b510bfa

Browse files
committed
Add spec for normalizer.
1 parent fd6e416 commit b510bfa

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

spec/github/normalizer_spec.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
require 'spec_helper'
2+
require 'github_api/core_ext/hash'
3+
4+
describe Github::Normalizer do
5+
let(:github) { Github.new }
6+
let(:repos_instance) { Github::Repos.new }
7+
let(:hash) { { :a => { :b => { :c => 1 } } } }
8+
9+
context '#normalize!' do
10+
it 'converts hash keys to string' do
11+
['a', 'b', 'c'].each do |key|
12+
github.repos.normalize!(hash).all_keys.should include key
13+
end
14+
[:a, :b, :c].each do |key|
15+
github.repos.normalize!(hash).all_keys.should_not include key
16+
end
17+
end
18+
end
19+
20+
end # Github::Normalizer

0 commit comments

Comments
 (0)