spec/firebrew/runner_spec.rb in firebrew-0.1.1 vs spec/firebrew/runner_spec.rb in firebrew-0.1.2

- old
+ new

@@ -5,11 +5,11 @@ describe '::default_config(platform)' do subject do Runner.default_config(self.platform) end - let(:platform){RUBY_PLATFORM} + let(:platform){'x86_64-darwin13.0'} before do ENV['FIREBREW_FIREFOX_PROFILE_BASE_DIR'] = nil ENV['FIREBREW_FIREFOX_PROFILE'] = nil ENV['FIREBREW_FIREFOX'] = nil @@ -25,22 +25,24 @@ let(:platform){'x86_64-darwin13.0'} it do is_expected.to eq( base_dir: '~/Library/Application Support/Firefox', firefox: '/Applications/Firefox.app/Contents/MacOS/firefox-bin', - profile: 'default' + profile: 'default', + os: 'darwin' ) end end context 'when the `platform` was "Linux"' do let(:platform){'x86_64-linux'} it do is_expected.to eq( base_dir: '~/.mozilla/firefox', firefox: '/usr/bin/firefox', - profile: 'default' + profile: 'default', + os: 'linux' ) end end context 'when the `platform` was "Windows"' do @@ -68,11 +70,12 @@ it do is_expected.to eq( base_dir: 'C:/Users/admin/AppData/Roaming/Mozilla/Firefox', firefox: 'C:/Program Files (x86)/Mozilla Firefox/firefox.exe', - profile: 'default' + profile: 'default', + os: 'winnt' ) end end context 'when the `platform` was "Windows XP x86"' do @@ -84,11 +87,12 @@ it do is_expected.to eq( base_dir: 'C:/Documents and Settings/Administrator/Application Data/Mozilla/Firefox', firefox: 'C:/Program Files/Mozilla Firefox/firefox.exe', - profile: 'default' + profile: 'default', + os: 'winnt' ) end end end @@ -102,11 +106,12 @@ it do is_expected.to eq( base_dir: 'C:/Users/admin/AppData/Roaming/Mozilla/Firefox', firefox: 'C:/Program Files (x86)/Mozilla Firefox/firefox.exe', - profile: 'default' + profile: 'default', + os: 'winnt' ) end end end end @@ -120,11 +125,12 @@ it do is_expected.to eq( base_dir: 'path/to/profile_base_directory', firefox: 'path/to/firefox', - profile: 'profile-name' + profile: 'profile-name', + os: 'darwin' ) end end end @@ -137,10 +143,10 @@ data_file: 'profiles.ini', firefox: ENV['OS'].nil? ? './spec/double/firefox.rb' : './spec/double/firefox.bat' ) end - let(:search_params){{term: 'hoge', version: '30.0', max: 1}} + let(:search_params){{term: 'hoge', version: '30.0', max: 1, os: Runner.default_config[:os]}} before do FileUtils.cp './spec/fixtures/firefox/profile/base.ini', './tmp/profiles.ini' response = File.read("./spec/fixtures/amo_api/search/base.xml") ActiveResource::HttpMock.respond_to do |mock|