spec/ rubocopied

This commit is contained in:
erwanlr
2013-01-24 22:00:17 +01:00
parent 3094d31633
commit b919c12d2f
39 changed files with 1789 additions and 1675 deletions

View File

@@ -1,24 +1,26 @@
# encoding: UTF-8
require 'spec_helper'
describe Plugin do
subject(:plugin) { Plugin.new }
describe "#new" do
context "with some infos" do
describe '#new' do
context 'with some infos' do
subject(:plugin) { Plugin.new(infos) }
let(:infos) { {:author => "John"} }
let(:infos) { { author: 'John' } }
its(:author) { should === infos[:author] }
end
end
describe "#run" do
it "should raise a NotImplementedError" do
describe '#run' do
it 'should raise a NotImplementedError' do
expect { plugin.run }.to raise_error(NotImplementedError)
end
end
describe "#register_options" do
describe '#register_options' do
after :each do
if @exception
expect { plugin.register_options(*@options) }.to raise_error(@exception)
@@ -28,16 +30,22 @@ describe Plugin do
end
end
context "when an option is not an Array" do
it "should raise an error" do
@options = [["-v", "--verbose", "It's a valid option"], "Not a valid one"]
@exception = "Each option must be an array, String supplied"
context 'when an option is not an Array' do
it 'should raise an error' do
@options = [
['-v', '--verbose', 'It\'s a valid option'],
'Not a valid one'
]
@exception = 'Each option must be an array, String supplied'
end
end
context "when options are Arrays" do
it "should register the options" do
@options = [["-v", "--verbose", "Verbose mode"], ["-u", "--url TARGET_URL"]]
context 'when options are Arrays' do
it 'should register the options' do
@options = [
['-v', '--verbose', 'Verbose mode'],
['-u', '--url TARGET_URL']
]
@expected = *@options
end
end