-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
53 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
require 'spec_helper' | ||
|
||
describe Space2dot::Cli do | ||
describe '#start' do | ||
subject { -> { described_class.new(argv).start } } | ||
|
||
context 'when arguments is empty' do | ||
let(:argv) { %w(this is class) } | ||
|
||
it { is_expected.to output(".this.is.class\n").to_stdout } | ||
end | ||
|
||
context 'when arguments is empty' do | ||
let(:argv) { Array.new } | ||
|
||
it { is_expected.not_to output(".this.is.class\n").to_stdout } | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# coding: utf-8 | ||
|
||
require 'spec_helper' | ||
|
||
describe Space2dot::Dot do | ||
let(:sentence) { %w(this is class) } | ||
let(:expected) { '.this.is.class' } | ||
|
||
subject { described_class.instance.convert(sentence) } | ||
|
||
context 'when an argument is an array' do | ||
let(:sentence) { ['this is class'] } | ||
|
||
it { is_expected.to eq expected } | ||
end | ||
|
||
context 'when an argument is multiple arrayies' do | ||
let(:sentence) { %w(this is class) } | ||
|
||
it { is_expected.to eq expected } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
|
||
describe Space2dot::Usage do | ||
subject { described_class.instance.text } | ||
|
||
it { is_expected.to be_a String } | ||
it { is_expected.not_to be_empty } | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters