Skip to content

Commit

Permalink
Quotes.
Browse files Browse the repository at this point in the history
  • Loading branch information
envygeeks committed Jul 4, 2013
1 parent f4946b1 commit 0d4bd51
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source "https://rubygems.org"
source 'https://rubygems.org'
gemspec

group :development do
Expand Down
24 changes: 12 additions & 12 deletions spec/lib/clippy_spec.rb
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
require "rspec/helper"
require 'rspec/helper'

shared_examples "Clippy" do
it "can paste" do
shared_examples 'Clippy' do
it 'can paste' do
expect(Clippy.copy(str = SecureRandom.hex)).to be_true
expect(Clippy.paste).to eq str
end

it "can copy" do
it 'can copy' do
expect(Clippy.copy(str = SecureRandom.hex)).to be_true
expect(get_clipboard_contents).to eq str
end

it "can clear" do
it 'can clear' do
Clippy.copy(SecureRandom.hex)
Clippy.clear
expect(Clippy.paste).to be_nil
end
end

describe "Clippy" do
describe 'Clippy' do
before :each do
clear_binary
Clippy.clear
Expand All @@ -27,16 +27,16 @@

it "sends clip for Windows" do
Clippy.stub(:windows?).and_return(true)
expect(Clippy.binary).to eq "clip"
expect(Clippy.binary).to eq 'clip'
end

context "with xclip" do
it_behaves_like "Clippy"
context 'with xclip' do
it_behaves_like 'Clippy'
end

context "with xsel" do
before(:each) { stub_binary("xsel") }
it_behaves_like "Clippy"
context 'with xsel' do
before(:each) { stub_binary('xsel') }
it_behaves_like 'Clippy'
end

it "raises UnknownClipboardError if it can't find the binary" do
Expand Down
14 changes: 7 additions & 7 deletions spec/rspec/helper.rb
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
unless %W(no false).include?(ENV["COVERAGE"])
unless %W(no false).include?(ENV['COVERAGE'])
unless Gem::Specification.find_all_by_name('envygeeks-coveralls').empty?
require 'envygeeks/coveralls'
end

SimpleCov.start do
add_filter "/spec/"
add_filter '/spec/'
end
end

require "securerandom"
require "clippy"
require 'securerandom'
require 'clippy'

def get_clipboard_contents
out = ""
out = ''

Open3.popen3("xclip -o -selection clipboard") do |stdin, stdout, stderr, pid|
Open3.popen3('xclip -o -selection clipboard') do |stdin, stdout, stderr, pid|
out = stdout.read.strip
end
out
end

def stub_binary(with = "xclip")
def stub_binary(with = 'xclip')
clear_binary
Clippy.send(:instance_variable_set, :@binary, with)
end
Expand Down

0 comments on commit 0d4bd51

Please sign in to comment.