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
def stub_env(new_env, &block) | |
original_env = Rails.env | |
Rails.instance_variable_set("@_env", ActiveSupport::StringInquirer.new(new_env)) | |
block.call | |
ensure | |
Rails.instance_variable_set("@_env", ActiveSupport::StringInquirer.new(original_env)) | |
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
def env | |
@_env ||= ActiveSupport::StringInquirer.new(ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development") | |
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
it "passes" do | |
stub_env "development" do | |
Rails.env.should be_development | |
end | |
Rails.env.should be_test | |
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
#!/bin/bash | |
find . -name "*.wma*" -delete |
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
#!/bin/bash | |
find . -name "*.nfo" -delete | |
find . -name "*.sfv" -delete | |
find . -name "*.m3u" -delete | |
find . -name "*.html" -delete | |
find . -name "*.md5" -delete | |
find . -name "*.pls" -delete |
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
#!/bin/bash | |
IFS=$'\n' | |
for FILE in `find . -name "*.wma.MP3" -type f` | |
do | |
mv $FILE `echo $FILE | sed s/.wma.MP3/.mp3/g` | |
done |
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
#!/bin/bash | |
echo -e "second\nthird\nfourth" > something.txt | |
echo -e "something.txt\n-------------" | |
cat something.txt | |
echo -e "first" | cat - something.txt > tmp && mv tmp something.txt | |
echo -e "\nsomething.txt\n-------------" | |
cat something.txt |
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
#!/bin/bash | |
echo -e "second\nthird\nfourth" > something.txt | |
echo -e "something.txt\n-------------" | |
cat something.txt | |
printf '%s\n' 0a "first" . w | ed -s something.txt | |
echo -e "\nsomething.txt\n-------------" | |
cat something.txt |
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
# Use the rspec generators | |
config.generators do |g| | |
g.view_specs false | |
g.helper_specs false | |
g.test_framework :rspec | |
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
let(:vehicle) { FactoryGirl.create(:vehicle, vehicle_attributes) } | |
let(:vehicle_attributes) { {} } | |
describe "#to_s" | |
subject { vehicle.to_s } | |
let(:vehicle_attributes) { {name: "Carzilla"} } | |
it { should == "Carzilla" } | |
end |
OlderNewer